home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 1.toast / pc / sample code / files / morefiles / cheaders / morefilesextras.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  113.6 KB  |  3,123 lines

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    A collection of useful high-level File Manager routines.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support Emeritus
  7. **
  8. **    File:        MoreFilesExtras.h
  9. **
  10. **    Copyright © 1992-1999 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILESEXTRAS__
  23. #define __MOREFILESEXTRAS__
  24.  
  25. #include <Types.h>
  26. #include <Files.h>
  27.  
  28. #include "Optimization.h"
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. /*****************************************************************************/
  35.  
  36. /*
  37. **    Macros to get information out of GetVolParmsInfoBuffer
  38. */
  39.  
  40. /* version 1 field getters */
  41. #define    GetVolParmsInfoVersion(volParms) \
  42.         ((volParms).vMVersion)
  43. #define    GetVolParmsInfoAttrib(volParms) \
  44.         ((volParms).vMAttrib)
  45. #define    GetVolParmsInfoLocalHand(volParms) \
  46.         ((volParms).vMLocalHand)
  47. #define    GetVolParmsInfoServerAdr(volParms) \
  48.         ((volParms).vMServerAdr)
  49. /* version 2 field getters (assume zero result if not version >= 2) */
  50. #define    GetVolParmsInfoVolumeGrade(volParms) \
  51.         (((volParms).vMVersion >= 2) ? (volParms).vMVolumeGrade : 0)
  52. #define    GetVolParmsInfoForeignPrivID(volParms) \
  53.         (((volParms).vMVersion >= 2) ? (volParms).vMForeignPrivID : 0)
  54. /* version 3 field getters (assume zero result if not version >= 3) */
  55. #define    GetVolParmsInfoExtendedAttributes(volParms) \
  56.         (((volParms).vMVersion >= 3) ? (volParms).vMExtendedAttributes : 0)
  57.  
  58. /* attribute bits supported by all versions of GetVolParmsInfoBuffer */
  59. #define isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  60. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  61. #define    hasLocalWList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  62. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  63. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  64. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  65. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  66. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  67. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  68. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  69. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  70. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  71. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  72. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  73. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  74. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  75. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  76. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  77. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  78. #define hasPersonalAccessPrivileges(volParms) \
  79.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  80. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  81. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  82. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  83. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  84. #define hasBlankAccessPrivileges(volParms) \
  85.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  86. #define supportsAsyncRequests(volParms) \
  87.         (((volParms).vMAttrib & (1L << bSupportsAsyncRequests)) != 0)
  88. #define supportsTrashVolumeCache(volParms) \
  89.         (((volParms).vMAttrib & (1L << bSupportsTrashVolumeCache)) != 0)
  90.  
  91. /* attribute bits supported by version 3 and greater versions of GetVolParmsInfoBuffer */
  92. #define volIsEjectable(volParms) \
  93.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bIsEjectable)) != 0)
  94. #define volSupportsHFSPlusAPIs(volParms) \
  95.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsHFSPlusAPIs)) != 0)
  96. #define volSupportsFSCatalogSearch(volParms) \
  97.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsFSCatalogSearch)) != 0)
  98. #define volSupportsFSExchangeObjects(volParms) \
  99.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsFSExchangeObjects)) != 0)
  100. #define volSupports2TBFiles(volParms) \
  101.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupports2TBFiles)) != 0)
  102. #define volSupportsLongNames(volParms) \
  103.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsLongNames)) != 0)
  104. #define volSupportsMultiScriptNames(volParms) \
  105.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsMultiScriptNames)) != 0)
  106. #define volSupportsNamedForks(volParms) \
  107.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsNamedForks)) != 0)
  108. #define volSupportsSubtreeIterators(volParms) \
  109.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bSupportsSubtreeIterators)) != 0)
  110. #define volL2PCanMapFileBlocks(volParms) \
  111.         ((GetVolParmsInfoExtendedAttributes(volParms) & (1L << bL2PCanMapFileBlocks)) != 0)
  112.  
  113. /*****************************************************************************/
  114.  
  115. /*
  116. **    Bit masks and macros to get common information out of ioACUser returned
  117. **    by PBGetCatInfo (remember to clear ioACUser before calling PBGetCatInfo
  118. **    since some file systems don't bother to set this field).
  119. **
  120. **    Use the GetDirAccessRestrictions or FSpGetDirAccessRestrictions
  121. **    functions to retrieve the ioACUser access restrictions byte for
  122. **    a folder.
  123. **
  124. **    Note:    The access restriction byte returned by PBGetCatInfo is the
  125. **            2's complement of the user's privileges byte returned in
  126. **            ioACAccess by PBHGetDirAccess.
  127. */
  128.  
  129. enum
  130. {
  131.     /* mask for just the access restriction bits */
  132.     acUserAccessMask        = (kioACUserNoSeeFolderMask + kioACUserNoSeeFilesMask + kioACUserNoMakeChangesMask),
  133.     
  134.     /* common access privilege settings */
  135.     acUserFull                = 0x00,                        /* no access restiction bits on */
  136.     acUserNone                = acUserAccessMask,            /* all access restiction bits on */
  137.     acUserDropBox            = kioACUserNoSeeFolderMask + kioACUserNoSeeFilesMask, /* make changes, but not see files or folders */
  138.     acUserBulletinBoard        = kioACUserNoMakeChangesMask /* see files and folders, but not make changes */
  139. };
  140.  
  141. /* Macros for testing ioACUser bits */
  142. #define    userIsOwner(ioACUser)    \
  143.         (((ioACUser) & kioACUserNotOwnerMask) == 0)
  144. #define    userHasFullAccess(ioACUser)    \
  145.         (((ioACUser) & (acUserAccessMask)) == acUserFull)
  146. #define    userHasDropBoxAccess(ioACUser)    \
  147.         (((ioACUser) & acUserAccessMask) == acUserDropBox)
  148. #define    userHasBulletinBoard(ioACUser)    \
  149.         (((ioACUser) & acUserAccessMask) == acUserBulletinBoard)
  150. #define    userHasNoAccess(ioACUser)        \
  151.         (((ioACUser) & acUserAccessMask) == acUserNone)
  152.  
  153. /*****************************************************************************/
  154.  
  155. /*
  156. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  157. **    FSpOpenAware, and FSpOpenRFAware functions.
  158. **    Note: Common settings are the ones with comments.
  159. */
  160.  
  161. enum
  162. {
  163.     dmNone            = 0x0000,
  164.     dmNoneDenyRd    = fsRdDenyPerm,
  165.     dmNoneDenyWr    = fsWrDenyPerm,
  166.     dmNoneDenyRdWr    = (fsRdDenyPerm + fsWrDenyPerm),
  167.     dmRd            = fsRdPerm,                        /* Single writer, multiple readers; the readers */
  168.     dmRdDenyRd        = (fsRdPerm + fsRdDenyPerm),
  169.     dmRdDenyWr        = (fsRdPerm + fsWrDenyPerm),    /* Browsing - equivalent to fsRdPerm */
  170.     dmRdDenyRdWr    = (fsRdPerm + fsRdDenyPerm + fsWrDenyPerm),
  171.     dmWr            = fsWrPerm,
  172.     dmWrDenyRd        = (fsWrPerm + fsRdDenyPerm),
  173.     dmWrDenyWr        = (fsWrPerm + fsWrDenyPerm),
  174.     dmWrDenyRdWr    = (fsWrPerm + fsRdDenyPerm + fsWrDenyPerm),
  175.     dmRdWr            = fsRdWrPerm,                    /* Shared access - equivalent to fsRdWrShPerm */
  176.     dmRdWrDenyRd    = (fsRdWrPerm + fsRdDenyPerm),
  177.     dmRdWrDenyWr    = (fsRdWrPerm + fsWrDenyPerm),    /* Single writer, multiple readers; the writer */
  178.     dmRdWrDenyRdWr    = (fsRdWrPerm + fsRdDenyPerm + fsWrDenyPerm) /* Exclusive access - equivalent to fsRdWrPerm */
  179. };
  180.     
  181. /*****************************************************************************/
  182.  
  183. #if PRAGMA_STRUCT_ALIGN
  184. #pragma options align=mac68k
  185. #endif
  186.  
  187. /*
  188. **    For those times where you need to use more than one kind of File Manager parameter
  189. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  190. */
  191.  
  192. union UniversalFMPB
  193. {
  194.     ParamBlockRec    PB;
  195.     CInfoPBRec        ciPB;
  196.     DTPBRec            dtPB;
  197.     HParamBlockRec    hPB;
  198.     CMovePBRec        cmPB;
  199.     WDPBRec            wdPB;
  200.     FCBPBRec        fcbPB;
  201.     XVolumeParam    xPB;
  202. };
  203. typedef union UniversalFMPB UniversalFMPB;
  204. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  205.  
  206.  
  207. /*
  208. **    Used by GetUGEntries to return user or group lists
  209. */
  210.  
  211. struct UGEntry
  212. {
  213.     short    objType;    /* object type: -1 = group; 0 = user */
  214.     long    objID;        /* the user or group ID */
  215.     Str31    name;        /* the user or group name */
  216. };
  217. typedef struct UGEntry UGEntry;
  218. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  219.  
  220.  
  221. typedef unsigned char Str8[9];
  222.  
  223.  
  224. /*
  225. **    I use the following records instead of the AFPVolMountInfo and AFPXVolMountInfo structures in Files.h
  226. */
  227.  
  228. struct MyAFPVolMountInfo
  229. {
  230.     short length;                /* length of this record */
  231.     VolumeType media;            /* type of media, always AppleShareMediaType */
  232.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  233.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  234.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  235.     short uamType;                /* User Authentication Method */
  236.     short zoneNameOffset;        /* offset from start of record to zoneName */
  237.     short serverNameOffset;        /* offset from start of record to serverName */
  238.     short volNameOffset;        /* offset from start of record to volName */
  239.     short userNameOffset;        /* offset from start of record to userName */
  240.     short userPasswordOffset;    /* offset from start of record to userPassword */
  241.     short volPasswordOffset;    /* offset from start of record to volPassword */
  242.     Str32 zoneName;                /* server's AppleTalk zone name */                    
  243.     char filler1;                /* to word align volPassword */
  244.     Str32 serverName;            /* server name */                    
  245.     char filler2;                /* to word align volPassword */
  246.     Str27 volName;                /* volume name */                    
  247.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  248.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  249.     char filler3;                /* to word align volPassword */
  250.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  251.     char filler4;                /* to end record on word boundry */
  252. };
  253. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  254. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  255.  
  256. struct MyAFPXVolMountInfo
  257. {
  258.     short length;                /* length of this record */
  259.     VolumeType media;            /* type of media, always AppleShareMediaType */
  260.     short flags;                /* bits for no messages, no reconnect, etc */
  261.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  262.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  263.     short uamType;                /* User Authentication Method */
  264.     short zoneNameOffset;        /* offset from start of record to zoneName */
  265.     short serverNameOffset;        /* offset from start of record to serverName */
  266.     short volNameOffset;        /* offset from start of record to volName */
  267.     short userNameOffset;        /* offset from start of record to userName */
  268.     short userPasswordOffset;    /* offset from start of record to userPassword */
  269.     short volPasswordOffset;    /* offset from start of record to volPassword */
  270.     short extendedFlags;        /* extended flags word */
  271.     short uamNameOffset;        /* offset to a pascal UAM name string */
  272.     short alternateAddressOffset; /* offset to Alternate Addresses in tagged format */
  273.     Str32 zoneName;                /* server's AppleTalk zone name */                    
  274.     char filler1;                /* to word align volPassword */
  275.     Str32 serverName;            /* server name */                    
  276.     char filler2;                /* to word align volPassword */
  277.     Str27 volName;                /* volume name */                    
  278.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  279.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  280.     char filler3;                /* to word align volPassword */
  281.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  282.     char filler4;                /* to word align uamNameOffset */
  283.     Str32 uamName;                /* UAM name */
  284.     char filler5;                /* to word align alternateAddress */
  285.     char alternateAddress[kVariableLengthArray];    /* AFPAlternateAddress */
  286. };
  287. typedef struct MyAFPXVolMountInfo MyAFPXVolMountInfo;
  288. typedef MyAFPXVolMountInfo *MyAFPXVolMountInfoPtr, **MyAFPXVolMountInfoHandle;
  289.  
  290. #if PRAGMA_STRUCT_ALIGN
  291. #pragma options align=reset
  292. #endif
  293.  
  294. /*****************************************************************************/
  295.  
  296. pascal    void    TruncPString(StringPtr destination,
  297.                              ConstStr255Param source,
  298.                              short maxLength);
  299. /*    ¶ International friendly string truncate routine.
  300.     The TruncPString function copies up to maxLength characters from
  301.     the source Pascal string to the destination Pascal string. TruncPString
  302.     ensures that the truncated string ends on a single-byte character, or on
  303.     the last byte of a multi-byte character.
  304.     
  305.     destination        output:    destination Pascal string.
  306.     source            input:    source Pascal string.
  307.     maxLength        output:    The maximum allowable length of the destination
  308.                             string.
  309. */
  310.  
  311. /*****************************************************************************/
  312.  
  313. pascal    Ptr    GetTempBuffer(long buffReqSize,
  314.                           long *buffActSize);
  315. /*    ¶ Allocate a temporary copy or search buffer.
  316.     The GetTempBuffer function allocates a temporary buffer for file system
  317.     operations which is at least 1024 bytes (1K) and a multiple of
  318.     1024 bytes.
  319.     
  320.     buffReqSize        input:    Size you'd like the buffer to be.
  321.     buffActSize        output:    Size of buffer allocated.
  322.     function result    output:    Pointer to memory allocated or nil if no memory
  323.                             was available. The caller is responsible for
  324.                             disposing of this buffer with DisposePtr.
  325. */
  326.  
  327. /*****************************************************************************/
  328.  
  329. pascal    OSErr    GetVolumeInfoNoName(ConstStr255Param pathname,
  330.                                     short vRefNum,
  331.                                     HParmBlkPtr pb);
  332. /*    ¶ Call PBHGetVInfoSync ignoring returned name.
  333.     GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync
  334.     in cases where the returned volume name is not needed by the caller.
  335.     The pathname and vRefNum parameters are not touched, and the pb
  336.     parameter is initialized by PBHGetVInfoSync except that ioNamePtr in
  337.     the parameter block is always returned as NULL (since it might point
  338.     to GetVolumeInfoNoName's local variable tempPathname).
  339.  
  340.     I noticed using this code in several places, so here it is once.
  341.     This reduces the code size of MoreFiles.
  342.  
  343.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  344.                         partial pathname, it is ignored. A full pathname to a
  345.                         volume must end with a colon character (:).
  346.     vRefNum        input:    Volume specification (volume reference number, working
  347.                         directory number, drive number, or 0).
  348.     pb            input:    A pointer to HParamBlockRec.
  349.                 output:    The parameter block as filled in by PBHGetVInfoSync
  350.                         except that ioNamePtr will always be NULL.
  351.     
  352.     Result Codes
  353.         noErr                0        No error
  354.         nsvErr                -35        No such volume
  355.         paramErr            -50        No default volume, or pb was NULL
  356. */
  357.  
  358. /*****************************************************************************/
  359.  
  360. pascal    OSErr    XGetVolumeInfoNoName(ConstStr255Param pathname,
  361.                                     short vRefNum,
  362.                                     XVolumeParamPtr pb);
  363. /*    ¶ Call PBXGetVolInfoSync ignoring returned name.
  364.     XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync
  365.     in cases where the returned volume name is not needed by the caller.
  366.     The pathname and vRefNum parameters are not touched, and the pb
  367.     parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in
  368.     the parameter block is always returned as NULL (since it might point
  369.     to XGetVolumeInfoNoName's local variable tempPathname).
  370.  
  371.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  372.                         partial pathname, it is ignored. A full pathname to a
  373.                         volume must end with a colon character (:).
  374.     vRefNum        input:    Volume specification (volume reference number, working
  375.                         directory number, drive number, or 0).
  376.     pb            input:    A pointer to HParamBlockRec.
  377.                 output:    The parameter block as filled in by PBXGetVolInfoSync
  378.                         except that ioNamePtr will always be NULL.
  379.     
  380.     Result Codes
  381.         noErr                0        No error
  382.         nsvErr                -35        No such volume
  383.         paramErr            -50        No default volume, or pb was NULL
  384. */
  385.  
  386. /*****************************************************************************/
  387.  
  388. pascal    OSErr GetCatInfoNoName(short vRefNum,
  389.                                long dirID,
  390.                                ConstStr255Param name,
  391.                                CInfoPBPtr pb);
  392. /*    ¶ Call PBGetCatInfoSync ignoring returned name.
  393.     GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync
  394.     in cases where the returned object is not needed by the caller.
  395.     The vRefNum, dirID and name parameters are not touched, and the pb
  396.     parameter is initialized by PBGetCatInfoSync except that ioNamePtr in
  397.     the parameter block is always returned as NULL (since it might point
  398.     to GetCatInfoNoName's local variable tempName).
  399.  
  400.     I noticed using this code in several places, so here it is once.
  401.     This reduces the code size of MoreFiles.
  402.  
  403.     vRefNum            input:    Volume specification.
  404.     dirID            input:    Directory ID.
  405.     name            input:    Pointer to object name, or nil when dirID
  406.                             specifies a directory that's the object.
  407.     pb                input:    A pointer to CInfoPBRec.
  408.                     output:    The parameter block as filled in by
  409.                             PBGetCatInfoSync except that ioNamePtr will
  410.                             always be NULL.
  411.     
  412.     Result Codes
  413.         noErr                0        No error
  414.         nsvErr                -35        No such volume
  415.         ioErr                -36        I/O error
  416.         bdNamErr            -37        Bad filename
  417.         fnfErr                -43        File not found
  418.         paramErr            -50        No default volume
  419.         dirNFErr            -120    Directory not found or incomplete pathname
  420.         afpAccessDenied        -5000    User does not have the correct access
  421.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  422.         
  423. */
  424.  
  425. /*****************************************************************************/
  426.  
  427. pascal    OSErr    DetermineVRefNum(ConstStr255Param pathname,
  428.                                  short vRefNum,
  429.                                  short *realVRefNum);
  430. /*    ¶ Determine the real volume reference number.
  431.     The DetermineVRefNum function determines the volume reference number of
  432.     a volume from a pathname, a volume specification, or a combination
  433.     of the two.
  434.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  435.     mounted volumes can have the same name. For this reason, the use of a
  436.     volume name or full pathname to identify a specific volume may not
  437.     produce the results you expect.  If more than one volume has the same
  438.     name and a volume name or full pathname is used, the File Manager
  439.     currently uses the first volume it finds with a matching name in the
  440.     volume queue.
  441.  
  442.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  443.                         partial pathname, it is ignored. A full pathname to a
  444.                         volume must end with a colon character (:).
  445.     vRefNum        input:    Volume specification (volume reference number, working
  446.                         directory number, drive number, or 0).
  447.     realVRefNum    output:    The real volume reference number.
  448.     
  449.     Result Codes
  450.         noErr                0        No error
  451.         nsvErr                -35        No such volume
  452.         paramErr            -50        No default volume
  453. */
  454.  
  455. /*****************************************************************************/
  456.  
  457. pascal    OSErr    HGetVInfo(short volReference,
  458.                           StringPtr volName,
  459.                           short *vRefNum,
  460.                           unsigned long *freeBytes,
  461.                           unsigned long *totalBytes);
  462. /*    ¶ Get information about a mounted volume.
  463.     The HGetVInfo function returns the name, volume reference number,
  464.     available space (in bytes), and total space (in bytes) for the
  465.     specified volume. You can specify the volume by providing its drive
  466.     number, volume reference number, or 0 for the default volume.
  467.     This routine is compatible with volumes up to 4 gigabytes.
  468.     
  469.     volReference    input:    The drive number, volume reference number,
  470.                             or 0 for the default volume.
  471.     volName            input:    A pointer to a buffer (minimum Str27) where
  472.                             the volume name is to be returned or must
  473.                             be nil.
  474.                     output:    The volume name.
  475.     vRefNum            output:    The volume reference number.
  476.     freeBytes        output:    The number of free bytes on the volume.
  477.                             freeBytes is an unsigned long value.
  478.     totalBytes        output:    The total number of bytes on the volume.
  479.                             totalBytes is an unsigned long value.
  480.     
  481.     Result Codes
  482.         noErr                0        No error
  483.         nsvErr                -35        No such volume
  484.         paramErr            -50        No default volume
  485.     
  486.     __________
  487.     
  488.     Also see:    XGetVInfo
  489. */
  490.  
  491. /*****************************************************************************/
  492.  
  493. pascal    OSErr    XGetVInfo(short volReference,
  494.                           StringPtr volName,
  495.                           short *vRefNum,
  496.                           UInt64 *freeBytes,
  497.                           UInt64 *totalBytes);
  498. /*    ¶ Get extended information about a mounted volume.
  499.     The XGetVInfo function returns the name, volume reference number,
  500.     available space (in bytes), and total space (in bytes) for the
  501.     specified volume. You can specify the volume by providing its drive
  502.     number, volume reference number, or 0 for the default volume.
  503.     This routine is compatible with volumes up to 2 terabytes.
  504.     
  505.     volReference    input:    The drive number, volume reference number,
  506.                             or 0 for the default volume.
  507.     volName            input:    A pointer to a buffer (minimum Str27) where
  508.                             the volume name is to be returned or must
  509.                             be nil.
  510.                     output:    The volume name.
  511.     vRefNum            output:    The volume reference number.
  512.     freeBytes        output:    The number of free bytes on the volume.
  513.                             freeBytes is an UnsignedWide value.
  514.     totalBytes        output:    The total number of bytes on the volume.
  515.                             totalBytes is an UnsignedWide value.
  516.     
  517.     Result Codes
  518.         noErr                0        No error
  519.         nsvErr                -35        No such volume
  520.         paramErr            -50        No default volume
  521.     
  522.     __________
  523.     
  524.     Also see:    HGetVInfo
  525. */
  526.  
  527. /*****************************************************************************/
  528.  
  529. pascal    OSErr    CheckVolLock(ConstStr255Param pathname,
  530.                              short vRefNum);
  531. /*    ¶ Determine if a volume is locked.
  532.     The CheckVolLock function determines if a volume is locked - either by
  533.     hardware or by software. If CheckVolLock returns noErr, then the volume
  534.     is not locked.
  535.  
  536.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  537.                         partial pathname, it is ignored. A full pathname to a
  538.                         volume must end with a colon character (:).
  539.     vRefNum        input:    Volume specification (volume reference number, working
  540.                         directory number, drive number, or 0).
  541.     
  542.     Result Codes
  543.         noErr                0        No error - volume not locked
  544.         nsvErr                -35        No such volume
  545.         wPrErr                -44        Volume locked by hardware
  546.         vLckdErr            -46        Volume locked by software
  547.         paramErr            -50        No default volume
  548. */
  549.  
  550. /*****************************************************************************/
  551. //
  552. //    The following routines call Mac OS routines that are not supported by
  553. //    Carbon:
  554. //    
  555. //        GetDriverName
  556. //        FindDrive
  557. //        GetDiskBlocks
  558. //        GetVolState
  559.  
  560. #if !TARGET_API_MAC_CARBON    //    {
  561.  
  562. /*****************************************************************************/
  563.  
  564. pascal    OSErr GetDriverName(short driverRefNum,
  565.                             Str255 driverName);
  566. /*    ¶ Get a device driver's name.
  567.     The GetDriverName function returns a device driver's name.
  568.  
  569.     driverRefNum    input:    The driver reference number.
  570.     driverName        output:    The driver's name.
  571.     
  572.     Result Codes
  573.         noErr                0        No error
  574.         badUnitErr            -21        Bad driver reference number
  575. */
  576.  
  577. /*****************************************************************************/
  578.  
  579. pascal    OSErr    FindDrive(ConstStr255Param pathname,
  580.                           short vRefNum,
  581.                           DrvQElPtr *driveQElementPtr);
  582. /*    ¶ Find a volume's drive queue element in the drive queue.
  583.     The FindDrive function returns a pointer to a mounted volume's
  584.     drive queue element.
  585.  
  586.     pathName            input:    Pointer to a full pathname or nil. If you
  587.                                 pass in a partial pathname, it is ignored.
  588.                                 A full pathname to a volume must end with
  589.                                 a colon character (:).
  590.     vRefNum                input:    Volume specification (volume reference
  591.                                 number, working directory number, drive
  592.                                 number, or 0).
  593.     driveQElementPtr    output:    Pointer to a volume's drive queue element
  594.                                 in the drive queue. DO NOT change the
  595.                                 DrvQEl.
  596.     
  597.     Result Codes
  598.         noErr                0        No error
  599.         nsvErr                -35        No such volume
  600.         paramErr            -50        No default volume
  601.         nsDrvErr            -56        No such drive
  602. */
  603.  
  604. /*****************************************************************************/
  605.  
  606. pascal    OSErr    GetDiskBlocks(ConstStr255Param pathname,
  607.                               short vRefNum,
  608.                               unsigned long *numBlocks);
  609. /*    ¶ Return the number of physical disk blocks on a disk drive.
  610.     The GetDiskBlocks function returns the number of physical disk
  611.     blocks on a disk drive. NOTE: This is not the same as volume
  612.     allocation blocks!
  613.  
  614.     pathName    input:    Pointer to a full pathname or nil. If you
  615.                         pass in a partial pathname, it is ignored.
  616.                         A full pathname to a volume must end with
  617.                         a colon character (:).
  618.     vRefNum        input:    Volume specification (volume reference
  619.                         number, working directory number, drive
  620.                         number, or 0).
  621.     numBlocks    output:    The number of physical disk blocks on the disk drive.
  622.     
  623.     Result Codes
  624.         noErr                0        No error
  625.         nsvErr                -35        No such volume
  626.         paramErr            -50        No default volume, driver reference
  627.                                     number is zero, ReturnFormatList
  628.                                     returned zero blocks, DriveStatus
  629.                                     returned an unknown value, or
  630.                                     driveQElementPtr->qType is unknown
  631.         nsDrvErr            -56        No such drive
  632.         statusErr            –18        Driver does not respond to this
  633.                                     status request
  634.         badUnitErr            –21        Driver reference number does not
  635.                                     match unit table
  636.         unitEmptyErr        –22        Driver reference number specifies
  637.                                     a nil handle in unit table
  638.         abortErr            –27        Request aborted by KillIO
  639.         notOpenErr            –28        Driver not open
  640. */
  641.  
  642. /*****************************************************************************/
  643.  
  644. pascal    OSErr    GetVolState(ConstStr255Param pathname,
  645.                             short vRefNum,
  646.                             Boolean *volumeOnline,
  647.                             Boolean *volumeEjected,
  648.                             Boolean *driveEjectable,
  649.                             Boolean *driverWantsEject);
  650. /*    ¶ Returns a volume's online and eject information.
  651.     The GetVolState function determines if a volume is online or offline,
  652.     if an offline volume is ejected, and if the volume's driver is
  653.     ejectable or wants eject calls.
  654.     
  655.     pathName            input:    Pointer to a full pathname or nil.
  656.     vRefNum                input:    Volume specification (volume reference number,
  657.                                 working directory number, drive number, or 0).
  658.     volumeOnline        output:    True if the volume is online;
  659.                                 False if the volume is offline.
  660.     volumeEjected        output:    True if the volume is ejected (ejected
  661.                                 volumes are always offline); False if the
  662.                                 volume is not ejected.
  663.     driveEjectable        output:    True if the volume's drive is ejectable;
  664.                                 False if the volume's drive is not ejectable.
  665.     driverWantsEject    output:    True if the volume's driver wants an Eject
  666.                                 request after unmount (even if the drive
  667.                                 is not ejectable); False if the volume's
  668.                                 driver does not need an eject request.
  669.     
  670.     Result Codes
  671.         noErr                0        No error
  672.         nsvErr                -35        No such volume
  673.         paramErr            -50        No default volume, or pb was NULL
  674. */
  675.  
  676.     /*****************************************************************************/
  677.  
  678. #endif    //    }    !TARGET_API_MAC_CARBON
  679.  
  680. /*****************************************************************************/
  681.  
  682. pascal    OSErr    GetVolFileSystemID(ConstStr255Param pathname,
  683.                                    short vRefNum,
  684.                                    short *fileSystemID);
  685. /*    ¶ Get a volume's file system ID.
  686.     The GetVolFileSystemID function returned the file system ID of
  687.     a mounted volume. The file system ID identifies the file system
  688.     that handles requests to a particular volume. Here's a partial list
  689.     of file system ID numbers (only Apple's file systems are listed):
  690.         FSID    File System
  691.         -----   -----------------------------------------------------
  692.         $0000    Macintosh HFS or MFS
  693.         $0100    ProDOS File System
  694.         $0101    PowerTalk Mail Enclosures
  695.         $4147    ISO 9660 File Access (through Foreign File Access)
  696.         $4242    High Sierra File Access (through Foreign File Access)
  697.         $464D    QuickTake File System (through Foreign File Access)
  698.         $4953    Macintosh PC Exchange (MS-DOS)
  699.         $4A48    Audio CD Access (through Foreign File Access)
  700.         $4D4B    Apple Photo Access (through Foreign File Access)
  701.     
  702.     See the Technical Note "FL 35 - Determining Which File System
  703.     Is Active" and the "Guide to the File System Manager" for more
  704.     information.
  705.     
  706.     pathName        input:    Pointer to a full pathname or nil.  If you pass
  707.                             in a partial pathname, it is ignored. A full
  708.                             pathname to a volume must contain at least
  709.                             one colon character (:) and must not start with
  710.                             a colon character.
  711.     vRefNum            input:    Volume specification (volume reference number,
  712.                             working directory number, drive number, or 0).
  713.     fileSystemID    output:    The volume's file system ID.
  714.     
  715.     Result Codes
  716.         noErr                0        No error
  717.         nsvErr                -35        No such volume
  718.         paramErr            -50        No default volume, or pb was NULL
  719. */
  720.  
  721. /*****************************************************************************/
  722.  
  723. pascal    OSErr    UnmountAndEject(ConstStr255Param pathname,
  724.                                 short vRefNum);
  725. /*    ¶ Unmount and eject a volume.
  726.     The UnmountAndEject function unmounts and ejects a volume. The volume
  727.     is ejected only if it is ejectable and not already ejected.
  728.     
  729.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  730.                         partial pathname, it is ignored. A full pathname to a
  731.                         volume must end with a colon character (:).
  732.     vRefNum        input:    Volume specification (volume reference number, working
  733.                         directory number, drive number, or 0).
  734.     
  735.     Result Codes
  736.         noErr                0        No error
  737.         nsvErr                -35        No such volume
  738.         ioErr                -36        I/O error
  739.         bdNamErr            -37        Bad volume name
  740.         fBsyErr                -47        One or more files are open
  741.         paramErr            -50        No default volume
  742.         nsDrvErr            -56        No such drive
  743.         extFSErr            -58        External file system error - no file
  744.                                     system claimed this call.
  745. */
  746.  
  747. /*****************************************************************************/
  748.  
  749. pascal    OSErr    OnLine(FSSpecPtr volumes,
  750.                        short reqVolCount,
  751.                        short *actVolCount,
  752.                        short *volIndex);
  753. /*    ¶ Return the list of volumes currently mounted.
  754.     The OnLine function returns the list of volumes currently mounted in
  755.     an array of FSSpec records.
  756.     
  757.     A noErr result indicates that the volumes array was filled
  758.     (actVolCount == reqVolCount) and there may be additional volumes
  759.     mounted. A nsvErr result indicates that the end of the volume list
  760.     was found and actVolCount volumes were actually found this time.
  761.  
  762.     volumes        input:    Pointer to array of FSSpec where the volume list
  763.                         is returned.
  764.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  765.                         elements in the volumes array).
  766.     actVolCount    output: The number of volumes actually returned.
  767.     volIndex    input:    The current volume index position. Set to 1 to
  768.                         start with the first volume.
  769.                 output:    The volume index position to get the next volume.
  770.                         Pass this value the next time you call OnLine to
  771.                         start where you left off.
  772.     
  773.     Result Codes
  774.         noErr                0        No error, but there are more volumes
  775.                                     to list
  776.         nsvErr                -35        No more volumes to be listed
  777.         paramErr            -50        volIndex was <= 0
  778. */
  779.  
  780. /*****************************************************************************/
  781.  
  782. pascal    OSErr SetDefault(short newVRefNum,
  783.                          long newDirID,
  784.                          short *oldVRefNum,
  785.                          long *oldDirID);
  786. /*    ¶ Set the default volume before making Standard I/O requests.
  787.     The SetDefault function sets the default volume and directory to the
  788.     volume specified by newVRefNum and the directory specified by newDirID.
  789.     The current default volume reference number and directory ID are
  790.     returned in oldVRefNum and oldDir and must be used to restore the
  791.     default volume and directory to their previous state *as soon as
  792.     possible* with the RestoreDefault function. These two functions are
  793.     designed to be used as a wrapper around Standard I/O routines where
  794.     the location of the file is implied to be the default volume and
  795.     directory. In other words, this is how you should use these functions:
  796.     
  797.         error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
  798.         if ( error == noErr )
  799.         {
  800.             // call the Stdio functions like remove, rename, tmpfile,
  801.             // fopen, freopen, etc. or non-ANSI extensions like
  802.             // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
  803.             
  804.             error = RestoreDefault(oldVRefNum, oldDirID);
  805.         }
  806.     
  807.     By using these functions as a wrapper, you won't need to open a working
  808.     directory (because SetDefault and RestoreDefault use HSetVol) and you
  809.     won't have to worry about the effects of using HSetVol (documented in
  810.     Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
  811.     Inside Macintosh: Files book in the description of the HSetVol and 
  812.     PBHSetVol functions) because the default volume/directory is restored
  813.     before giving up control to code that might be affected by HSetVol.
  814.     
  815.     newVRefNum    input:    Volume specification (volume reference number,
  816.                         working directory number, drive number, or 0) of
  817.                         the new default volume.
  818.     newDirID    input:    Directory ID of the new default directory.
  819.     oldVRefNum    output: The volume specification to save for use with
  820.                         RestoreDefault.
  821.     oldDirID    output:    The directory ID to save for use with
  822.                         RestoreDefault.
  823.     
  824.     Result Codes
  825.         noErr                0        No error
  826.         nsvErr                -35        No such volume
  827.         bdNamErr            -37        Bad volume name
  828.         fnfErr                -43        Directory not found
  829.         paramErr            -50        No default volume
  830.         afpAccessDenied        -5000    User does not have access to the directory
  831.     
  832.     __________
  833.     
  834.     Also see:    RestoreDefault
  835. */
  836.  
  837. /*****************************************************************************/
  838.  
  839. pascal    OSErr RestoreDefault(short oldVRefNum,
  840.                              long oldDirID);
  841. /*    ¶ Restore the default volume after making Standard C I/O requests.
  842.     The RestoreDefault function restores the default volume and directory
  843.     to the volume specified by oldVRefNum and the directory specified by 
  844.     oldDirID. The oldVRefNum and oldDirID parameters were previously
  845.     obtained from the SetDefault function. These two functions are designed
  846.     to be used as a wrapper around Standard C I/O routines where the
  847.     location of the file is implied to be the default volume and directory.
  848.     In other words, this is how you should use these functions:
  849.     
  850.         error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
  851.         if ( error == noErr )
  852.         {
  853.             // call the Stdio functions like remove, rename, tmpfile,
  854.             // fopen, freopen, etc. or non-ANSI extensions like
  855.             // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
  856.             
  857.             error = RestoreDefault(oldVRefNum, oldDirID);
  858.         }
  859.     
  860.     By using these functions as a wrapper, you won't need to open a working
  861.     directory (because SetDefault and RestoreDefault use HSetVol) and you
  862.     won't have to worry about the effects of using HSetVol (documented in
  863.     Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
  864.     Inside Macintosh: Files book in the description of the HSetVol and 
  865.     PBHSetVol functions) because the default volume/directory is restored
  866.     before giving up control to code that might be affected by HSetVol.
  867.     
  868.     oldVRefNum    input: The volume specification to restore.
  869.     oldDirID    input:    The directory ID to restore.
  870.     
  871.     Result Codes
  872.         noErr                0        No error
  873.         nsvErr                -35        No such volume
  874.         bdNamErr            -37        Bad volume name
  875.         fnfErr                -43        Directory not found
  876.         paramErr            -50        No default volume
  877.         rfNumErr            -51        Bad working directory reference number
  878.         afpAccessDenied        -5000    User does not have access to the directory
  879.     
  880.     __________
  881.     
  882.     Also see:    SetDefault
  883. */
  884.  
  885. /*****************************************************************************/
  886.  
  887. pascal    OSErr GetDInfo(short vRefNum,
  888.                        long dirID,
  889.                        ConstStr255Param name,
  890.                        DInfo *fndrInfo);
  891. /*    ¶ Get the finder information for a directory.
  892.     The GetDInfo function gets the finder information for a directory.
  893.  
  894.     vRefNum            input:    Volume specification.
  895.     dirID            input:    Directory ID.
  896.     name            input:    Pointer to object name, or nil when dirID
  897.                             specifies a directory that's the object.
  898.     fndrInfo        output:    If the object is a directory, then its DInfo.
  899.     
  900.     Result Codes
  901.         noErr                0        No error
  902.         nsvErr                -35        No such volume
  903.         ioErr                -36        I/O error
  904.         bdNamErr            -37        Bad filename
  905.         fnfErr                -43        File not found
  906.         paramErr            -50        No default volume
  907.         dirNFErr            -120    Directory not found or incomplete pathname
  908.         afpAccessDenied        -5000    User does not have the correct access
  909.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  910.         
  911.     __________
  912.     
  913.     Also see:    FSpGetDInfo, FSpGetFInfoCompat
  914. */
  915.  
  916. /*****************************************************************************/
  917.  
  918. pascal    OSErr FSpGetDInfo(const FSSpec *spec,
  919.                           DInfo *fndrInfo);
  920. /*    ¶ Get the finder information for a directory.
  921.     The FSpGetDInfo function gets the finder information for a directory.
  922.  
  923.     spec        input:    An FSSpec record specifying the directory.
  924.     fndrInfo    output:    If the object is a directory, then its DInfo.
  925.     
  926.     Result Codes
  927.         noErr                0        No error
  928.         nsvErr                -35        No such volume
  929.         ioErr                -36        I/O error
  930.         bdNamErr            -37        Bad filename
  931.         fnfErr                -43        File not found
  932.         paramErr            -50        No default volume
  933.         dirNFErr            -120    Directory not found or incomplete pathname
  934.         afpAccessDenied        -5000    User does not have the correct access
  935.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  936.         
  937.     __________
  938.     
  939.     Also see:    FSpGetFInfoCompat, GetDInfo
  940. */
  941.  
  942. /*****************************************************************************/
  943.  
  944. pascal    OSErr SetDInfo(short vRefNum,
  945.                        long dirID,
  946.                        ConstStr255Param name,
  947.                        const DInfo *fndrInfo);
  948. /*    ¶ Set the finder information for a directory.
  949.     The SetDInfo function sets the finder information for a directory.
  950.  
  951.     vRefNum            input:    Volume specification.
  952.     dirID            input:    Directory ID.
  953.     name            input:    Pointer to object name, or nil when dirID
  954.                             specifies a directory that's the object.
  955.     fndrInfo        input:    The DInfo.
  956.     
  957.     Result Codes
  958.         noErr                0        No error
  959.         nsvErr                -35        No such volume
  960.         ioErr                -36        I/O error
  961.         bdNamErr            -37        Bad filename
  962.         fnfErr                -43        File not found
  963.         fLckdErr            -45        File is locked
  964.         vLckdErr            -46        Volume is locked or read-only
  965.         paramErr            -50        No default volume
  966.         dirNFErr            -120    Directory not found or incomplete pathname
  967.         afpAccessDenied        -5000    User does not have the correct access
  968.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  969.     
  970.     __________
  971.     
  972.     Also see:    FSpSetDInfo, FSpSetFInfoCompat
  973. */
  974.  
  975. /*****************************************************************************/
  976.  
  977. pascal    OSErr FSpSetDInfo(const FSSpec *spec,
  978.                           const DInfo *fndrInfo);
  979. /*    ¶ Set the finder information for a directory.
  980.     The FSpSetDInfo function sets the finder information for a directory.
  981.  
  982.     spec        input:    An FSSpec record specifying the directory.
  983.     fndrInfo    input:    The DInfo.
  984.     
  985.     Result Codes
  986.         noErr                0        No error
  987.         nsvErr                -35        No such volume
  988.         ioErr                -36        I/O error
  989.         bdNamErr            -37        Bad filename
  990.         fnfErr                -43        File not found
  991.         fLckdErr            -45        File is locked
  992.         vLckdErr            -46        Volume is locked or read-only
  993.         paramErr            -50        No default volume
  994.         dirNFErr            -120    Directory not found or incomplete pathname
  995.         afpAccessDenied        -5000    User does not have the correct access
  996.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  997.     
  998.     __________
  999.     
  1000.     Also see:    FSpSetFInfoCompat, SetDInfo
  1001. */
  1002.  
  1003. /*****************************************************************************/
  1004.  
  1005. #if OLDROUTINENAMES
  1006. #define    GetDirID(vRefNum, dirID, name, theDirID, isDirectory)    \
  1007.         GetDirectoryID(vRefNum, dirID, name, theDirID, isDirectory)
  1008. #endif
  1009.  
  1010. pascal    OSErr    GetDirectoryID(short vRefNum,
  1011.                                long dirID,
  1012.                                ConstStr255Param name,
  1013.                                long *theDirID,
  1014.                                Boolean *isDirectory);
  1015. /*    ¶ Get the directory ID number of the directory specified.
  1016.     The GetDirectoryID function gets the directory ID number of the
  1017.     directory specified.  If a file is specified, then the parent
  1018.     directory of the file is returned and isDirectory is false.  If
  1019.     a directory is specified, then that directory's ID number is
  1020.     returned and isDirectory is true.
  1021.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  1022.     mounted volumes can have the same name. For this reason, the use of a
  1023.     volume name or full pathname to identify a specific volume may not
  1024.     produce the results you expect.  If more than one volume has the same
  1025.     name and a volume name or full pathname is used, the File Manager
  1026.     currently uses the first volume it finds with a matching name in the
  1027.     volume queue.
  1028.     
  1029.     vRefNum            input:    Volume specification.
  1030.     dirID            input:    Directory ID.
  1031.     name            input:    Pointer to object name, or nil when dirID
  1032.                             specifies a directory that's the object.
  1033.     theDirID        output:    If the object is a file, then its parent directory
  1034.                             ID. If the object is a directory, then its ID.
  1035.     isDirectory        output:    True if object is a directory; false if
  1036.                             object is a file.
  1037.     
  1038.     Result Codes
  1039.         noErr                0        No error
  1040.         nsvErr                -35        No such volume
  1041.         ioErr                -36        I/O error
  1042.         bdNamErr            -37        Bad filename
  1043.         fnfErr                -43        File not found
  1044.         paramErr            -50        No default volume
  1045.         dirNFErr            -120    Directory not found or incomplete pathname
  1046.         afpAccessDenied        -5000    User does not have the correct access
  1047.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1048. */
  1049.  
  1050. /*****************************************************************************/
  1051.  
  1052. #if OLDROUTINENAMES
  1053. #define    DirIDFromFSSpec(spec, theDirID, isDirectory)    \
  1054.         FSpGetDirectoryID(spec, theDirID, isDirectory)
  1055. #endif
  1056.  
  1057. pascal    OSErr    FSpGetDirectoryID(const FSSpec *spec,
  1058.                                   long *theDirID,
  1059.                                   Boolean *isDirectory);
  1060. /*    ¶ Get the directory ID number of a directory.
  1061.     The FSpGetDirectoryID function gets the directory ID number of the
  1062.     directory specified by spec. If spec is to a file, then the parent
  1063.     directory of the file is returned and isDirectory is false.  If
  1064.     spec is to a directory, then that directory's ID number is
  1065.     returned and isDirectory is true.
  1066.     
  1067.     spec            input:    An FSSpec record specifying the directory.
  1068.     theDirID        output:    The directory ID.
  1069.     isDirectory        output:    True if object is a directory; false if
  1070.                             object is a file.
  1071.     
  1072.     Result Codes
  1073.         noErr                0        No error
  1074.         nsvErr                -35        No such volume
  1075.         ioErr                -36        I/O error
  1076.         bdNamErr            -37        Bad filename
  1077.         fnfErr                -43        File not found
  1078.         paramErr            -50        No default volume
  1079.         dirNFErr            -120    Directory not found or incomplete pathname
  1080.         afpAccessDenied        -5000    User does not have the correct access
  1081.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1082. */
  1083.  
  1084. /*****************************************************************************/
  1085.  
  1086. pascal    OSErr    GetDirName(short vRefNum,
  1087.                            long dirID,
  1088.                            Str31 name);
  1089. /*    ¶ Get the name of a directory from its directory ID.
  1090.     The GetDirName function gets the name of a directory from its
  1091.     directory ID.
  1092.  
  1093.     vRefNum        input:    Volume specification.
  1094.     dirID        input:    Directory ID.
  1095.     name        output:    Points to a Str31 where the directory name is to be
  1096.                         returned.
  1097.     
  1098.     Result Codes
  1099.         noErr                0        No error
  1100.         nsvErr                -35        No such volume
  1101.         ioErr                -36        I/O error
  1102.         bdNamErr            -37        Bad filename
  1103.         fnfErr                -43        File not found
  1104.         paramErr            -50        No default volume or
  1105.                                     name parameter was NULL
  1106.         dirNFErr            -120    Directory not found or incomplete pathname
  1107.         afpAccessDenied        -5000    User does not have the correct access
  1108.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1109. */
  1110.  
  1111. /*****************************************************************************/
  1112.  
  1113. pascal    OSErr    GetIOACUser(short vRefNum,
  1114.                             long dirID,
  1115.                             ConstStr255Param name,
  1116.                             SInt8 *ioACUser);
  1117. /*    ¶ Get a directory's access restrictions byte.
  1118.     GetIOACUser returns a directory's access restrictions byte.
  1119.     Use the masks and macro defined in MoreFilesExtras to check for
  1120.     specific access priviledges.
  1121.     
  1122.     vRefNum        input:    Volume specification.
  1123.     dirID        input:    Directory ID.
  1124.     name        input:    Pointer to object name, or nil when dirID
  1125.                         specifies a directory that's the object.
  1126.     ioACUser    output:    The access restriction byte
  1127.     
  1128.     Result Codes
  1129.         noErr                0        No error
  1130.         nsvErr                -35        No such volume
  1131.         ioErr                -36        I/O error
  1132.         bdNamErr            -37        Bad filename
  1133.         fnfErr                -43        File not found
  1134.         paramErr            -50        No default volume
  1135.         dirNFErr            -120    Directory not found or incomplete pathname
  1136.         afpAccessDenied        -5000    User does not have the correct access
  1137.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1138. */
  1139.  
  1140. /*****************************************************************************/
  1141.  
  1142. pascal    OSErr    FSpGetIOACUser(const FSSpec *spec,
  1143.                                SInt8 *ioACUser);
  1144. /*    ¶ Get a directory's access restrictions byte.
  1145.     FSpGetIOACUser returns a directory's access restrictions byte.
  1146.     Use the masks and macro defined in MoreFilesExtras to check for
  1147.     specific access priviledges.
  1148.     
  1149.     spec        input:    An FSSpec record specifying the directory.
  1150.     ioACUser    output:    The access restriction byte
  1151.     
  1152.     Result Codes
  1153.         noErr                0        No error
  1154.         nsvErr                -35        No such volume
  1155.         ioErr                -36        I/O error
  1156.         bdNamErr            -37        Bad filename
  1157.         fnfErr                -43        File not found
  1158.         paramErr            -50        No default volume
  1159.         dirNFErr            -120    Directory not found or incomplete pathname
  1160.         afpAccessDenied        -5000    User does not have the correct access
  1161.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1162. */
  1163.  
  1164. /*****************************************************************************/
  1165.  
  1166. pascal    OSErr    GetParentID(short vRefNum,
  1167.                             long dirID,
  1168.                             ConstStr255Param name,
  1169.                             long *parID);
  1170. /*    ¶ Get the parent directory ID number of the specified object.
  1171.     The GetParentID function gets the parent directory ID number of the
  1172.     specified object.
  1173.     
  1174.     vRefNum        input:    Volume specification.
  1175.     dirID        input:    Directory ID.
  1176.     name        input:    Pointer to object name, or nil when dirID specifies
  1177.                         a directory that's the object.
  1178.     parID        output:    The parent directory ID of the specified object.
  1179.     
  1180.     Result Codes
  1181.         noErr                0        No error
  1182.         nsvErr                -35        No such volume
  1183.         ioErr                -36        I/O error
  1184.         bdNamErr            -37        Bad filename
  1185.         fnfErr                -43        File not found
  1186.         paramErr            -50        No default volume
  1187.         dirNFErr            -120    Directory not found or incomplete pathname
  1188.         afpAccessDenied        -5000    User does not have the correct access
  1189.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1190. */
  1191.  
  1192. /*****************************************************************************/
  1193.  
  1194. pascal    OSErr    GetFilenameFromPathname(ConstStr255Param pathname,
  1195.                                         Str255 filename);
  1196. /*    ¶ Get the object name from the end of a full or partial pathname.
  1197.     The GetFilenameFromPathname function gets the file (or directory) name
  1198.     from the end of a full or partial pathname. Returns notAFileErr if the
  1199.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  1200.     a filename (with a noErr result, the pathname could still refer to a
  1201.     directory).
  1202.     
  1203.     pathname    input:    A full or partial pathname.
  1204.     filename    output:    The file (or directory) name.
  1205.     
  1206.     Result Codes
  1207.         noErr                0        No error
  1208.         notAFileErr            -1302    The pathname is nil, the pathname
  1209.                                     is empty, or the pathname cannot refer
  1210.                                     to a filename
  1211.     
  1212.     __________
  1213.     
  1214.     See also:    GetObjectLocation.
  1215. */
  1216.  
  1217. /*****************************************************************************/
  1218.  
  1219. pascal    OSErr    GetObjectLocation(short vRefNum,
  1220.                                   long dirID,
  1221.                                   ConstStr255Param pathname,
  1222.                                   short *realVRefNum,
  1223.                                   long *realParID,
  1224.                                   Str255 realName,
  1225.                                   Boolean *isDirectory);
  1226. /*    ¶ Get a file system object's location.
  1227.     The GetObjectLocation function gets a file system object's location -
  1228.     that is, its real volume reference number, real parent directory ID,
  1229.     and name. While we're at it, determine if the object is a file or directory.
  1230.     If GetObjectLocation returns fnfErr, then the location information
  1231.     returned is valid, but it describes an object that doesn't exist.
  1232.     You can use the location information for another operation, such as
  1233.     creating a file or directory.
  1234.     
  1235.     vRefNum        input:    Volume specification.
  1236.     dirID        input:    Directory ID.
  1237.     pathname    input:    Pointer to object name, or nil when dirID specifies
  1238.                         a directory that's the object.
  1239.     realVRefNum    output:    The real volume reference number.
  1240.     realParID    output:    The parent directory ID of the specified object.
  1241.     realName    output:    The name of the specified object (the case of the
  1242.                         object name may not be the same as the object's
  1243.                         catalog entry on disk - since the Macintosh file
  1244.                         system is not case sensitive, it shouldn't matter).
  1245.     isDirectory    output:    True if object is a directory; false if object
  1246.                         is a file.
  1247.     
  1248.     Result Codes
  1249.         noErr                0        No error
  1250.         nsvErr                -35        No such volume
  1251.         ioErr                -36        I/O error
  1252.         bdNamErr            -37        Bad filename
  1253.         fnfErr                -43        File not found
  1254.         paramErr            -50        No default volume
  1255.         dirNFErr            -120    Directory not found or incomplete pathname
  1256.         notAFileErr            -1302    The pathname is nil, the pathname
  1257.                                     is empty, or the pathname cannot refer
  1258.                                     to a filename
  1259.         afpAccessDenied        -5000    User does not have the correct access
  1260.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1261.     
  1262.     __________
  1263.     
  1264.     See also:    FSMakeFSSpecCompat
  1265. */
  1266.  
  1267. /*****************************************************************************/
  1268.  
  1269. pascal    OSErr    GetDirItems(short vRefNum,
  1270.                             long dirID,
  1271.                             ConstStr255Param name,
  1272.                             Boolean getFiles,
  1273.                             Boolean getDirectories,
  1274.                             FSSpecPtr items,
  1275.                             short reqItemCount,
  1276.                             short *actItemCount,
  1277.                             short *itemIndex);
  1278. /*    ¶ Return a list of items in a directory.
  1279.     The GetDirItems function returns a list of items in the specified
  1280.     directory in an array of FSSpec records. File, subdirectories, or
  1281.     both can be returned in the list.
  1282.     
  1283.     A noErr result indicates that the items array was filled
  1284.     (actItemCount == reqItemCount) and there may be additional items
  1285.     left in the directory. A fnfErr result indicates that the end of
  1286.     the directory list was found and actItemCount items were actually
  1287.     found this time.
  1288.  
  1289.     vRefNum            input:    Volume specification.
  1290.     dirID            input:    Directory ID.
  1291.     name            input:    Pointer to object name, or nil when dirID
  1292.                             specifies a directory that's the object.
  1293.     getFiles        input:    Pass true to have files added to the items list.
  1294.     getDirectories    input:    Pass true to have directories added to the
  1295.                             items list.
  1296.     items            input:    Pointer to array of FSSpec where the item list
  1297.                             is returned.
  1298.     reqItemCount    input:    Maximum number of items to return (the number
  1299.                             of elements in the items array).
  1300.     actItemCount    output: The number of items actually returned.
  1301.     itemIndex        input:    The current item index position. Set to 1 to
  1302.                             start with the first item in the directory.
  1303.                     output:    The item index position to get the next item.
  1304.                             Pass this value the next time you call
  1305.                             GetDirItems to start where you left off.
  1306.     
  1307.     Result Codes
  1308.         noErr                0        No error, but there are more items
  1309.                                     to list
  1310.         nsvErr                -35        No such volume
  1311.         ioErr                -36        I/O error
  1312.         bdNamErr            -37        Bad filename
  1313.         fnfErr                -43        File not found, there are no more items
  1314.                                     to be listed.
  1315.         paramErr            -50        No default volume or itemIndex was <= 0
  1316.         dirNFErr            -120    Directory not found or incomplete pathname
  1317.         afpAccessDenied        -5000    User does not have the correct access
  1318.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1319. */
  1320.  
  1321. /*****************************************************************************/
  1322.  
  1323. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  1324.                                          long dirID,
  1325.                                         ConstStr255Param name);
  1326. /*    ¶ Delete the contents of a directory.
  1327.     The DeleteDirectoryContents function deletes the contents of a directory.
  1328.     All files and subdirectories in the specified directory are deleted.
  1329.     If a locked file or directory is encountered, it is unlocked and then
  1330.     deleted.  If any unexpected errors are encountered,
  1331.     DeleteDirectoryContents quits and returns to the caller.
  1332.     
  1333.     vRefNum    input:    Volume specification.
  1334.     dirID    input:    Directory ID.
  1335.     name    input:    Pointer to directory name, or nil when dirID specifies
  1336.                     a directory that's the object.
  1337.     
  1338.     Result Codes
  1339.         noErr                0        No error
  1340.         nsvErr                -35        No such volume
  1341.         ioErr                -36        I/O error
  1342.         bdNamErr            -37        Bad filename
  1343.         fnfErr                -43        File not found
  1344.         wPrErr                -44        Hardware volume lock    
  1345.         fLckdErr            -45        File is locked    
  1346.         vLckdErr            -46        Software volume lock    
  1347.         fBsyErr                -47        File busy, directory not empty, or working directory control block open    
  1348.         paramErr            -50        No default volume
  1349.         dirNFErr            -120    Directory not found or incomplete pathname
  1350.         afpAccessDenied        -5000    User does not have the correct access
  1351.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1352.     
  1353.     __________
  1354.     
  1355.     Also see:    DeleteDirectory
  1356. */
  1357.  
  1358. /*****************************************************************************/
  1359.  
  1360. pascal    OSErr    DeleteDirectory(short vRefNum,
  1361.                                 long dirID,
  1362.                                 ConstStr255Param name);
  1363. /*    ¶ Delete a directory and its contents.
  1364.     The DeleteDirectory function deletes a directory and its contents.
  1365.     All files and subdirectories in the specified directory are deleted.
  1366.     If a locked file or directory is encountered, it is unlocked and then
  1367.     deleted.  After deleting the directories contents, the directory is
  1368.     deleted. If any unexpected errors are encountered, DeleteDirectory
  1369.     quits and returns to the caller.
  1370.     
  1371.     vRefNum    input:    Volume specification.
  1372.     dirID    input:    Directory ID.
  1373.     name    input:    Pointer to directory name, or nil when dirID specifies
  1374.                     a directory that's the object.
  1375.     
  1376.     Result Codes
  1377.         noErr                0        No error
  1378.         nsvErr                -35        No such volume
  1379.         ioErr                -36        I/O error
  1380.         bdNamErr            -37        Bad filename
  1381.         fnfErr                -43        File not found
  1382.         wPrErr                -44        Hardware volume lock
  1383.         fLckdErr            -45        File is locked
  1384.         vLckdErr            -46        Software volume lock
  1385.         fBsyErr                -47        File busy, directory not empty, or working directory control block open    
  1386.         paramErr            -50        No default volume
  1387.         dirNFErr            -120    Directory not found or incomplete pathname
  1388.         afpAccessDenied        -5000    User does not have the correct access
  1389.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1390.     
  1391.     __________
  1392.     
  1393.     Also see:    DeleteDirectoryContents
  1394. */
  1395.  
  1396. /*****************************************************************************/
  1397.  
  1398. pascal    OSErr    CheckObjectLock(short vRefNum,
  1399.                                 long dirID,
  1400.                                 ConstStr255Param name);
  1401. /*    ¶ Determine if a file or directory is locked.
  1402.     The CheckObjectLock function determines if a file or directory is locked.
  1403.     If CheckObjectLock returns noErr, then the file or directory
  1404.     is not locked. If CheckObjectLock returns fLckdErr, the it is locked.
  1405.     
  1406.     vRefNum    input:    Volume specification.
  1407.     dirID    input:    Directory ID.
  1408.     name    input:    Pointer to object name, or nil when dirID specifies
  1409.                     a directory that's the object.
  1410.     
  1411.     Result Codes
  1412.         noErr                0        No error
  1413.         nsvErr                -35        No such volume
  1414.         ioErr                -36        I/O error
  1415.         bdNamErr            -37        Bad filename
  1416.         fnfErr                -43        File not found
  1417.         fLckdErr            -45        File is locked
  1418.         paramErr            -50        No default volume
  1419.         dirNFErr            -120    Directory not found or incomplete pathname
  1420.         afpAccessDenied        -5000    User does not have the correct access
  1421.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1422.     
  1423.     __________
  1424.     
  1425.     Also see:    FSpCheckObjectLock
  1426. */
  1427.  
  1428. /*****************************************************************************/
  1429.  
  1430. pascal    OSErr    FSpCheckObjectLock(const FSSpec *spec);
  1431. /*    ¶ Determine if a file or directory is locked.
  1432.     The FSpCheckObjectLock function determines if a file or directory is locked.
  1433.     If FSpCheckObjectLock returns noErr, then the file or directory
  1434.     is not locked.
  1435.     
  1436.     spec    input:    An FSSpec record specifying the object.
  1437.     
  1438.     Result Codes
  1439.         noErr                0        No error
  1440.         nsvErr                -35        No such volume
  1441.         ioErr                -36        I/O error
  1442.         bdNamErr            -37        Bad filename
  1443.         fnfErr                -43        File not found
  1444.         fLckdErr            -45        File is locked
  1445.         paramErr            -50        No default volume
  1446.         dirNFErr            -120    Directory not found or incomplete pathname
  1447.         afpAccessDenied        -5000    User does not have the correct access
  1448.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1449.     
  1450.     __________
  1451.     
  1452.     Also see:    CheckObjectLock
  1453. */
  1454.  
  1455. /*****************************************************************************/
  1456.  
  1457. pascal    OSErr    GetFileSize(short vRefNum,
  1458.                             long dirID,
  1459.                             ConstStr255Param fileName,
  1460.                             long *dataSize,
  1461.                             long *rsrcSize);
  1462. /*    ¶ Get the logical sizes of a file's forks.
  1463.     The GetFileSize function returns the logical size of a file's
  1464.     data and resource fork.
  1465.     
  1466.     vRefNum        input:    Volume specification.
  1467.     dirID        input:    Directory ID.
  1468.     name        input:    The name of the file.
  1469.     dataSize    output:    The number of bytes in the file's data fork.
  1470.     rsrcSize    output:    The number of bytes in the file's resource fork.
  1471.     
  1472.     Result Codes
  1473.         noErr                0        No error
  1474.         nsvErr                -35        No such volume
  1475.         ioErr                -36        I/O error
  1476.         bdNamErr            -37        Bad filename
  1477.         fnfErr                -43        File not found
  1478.         paramErr            -50        No default volume
  1479.         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
  1480.         afpAccessDenied        -5000    User does not have the correct access
  1481.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1482.     
  1483.     __________
  1484.     
  1485.     See also:    FSpGetFileSize
  1486. */
  1487.  
  1488. /*****************************************************************************/
  1489.  
  1490. pascal    OSErr    FSpGetFileSize(const FSSpec *spec,
  1491.                                long *dataSize,
  1492.                                long *rsrcSize);
  1493. /*    ¶ Get the logical sizes of a file's forks.
  1494.     The FSpGetFileSize function returns the logical size of a file's
  1495.     data and resource fork.
  1496.     
  1497.     spec        input:    An FSSpec record specifying the file.
  1498.     dataSize    output:    The number of bytes in the file's data fork.
  1499.     rsrcSize    output:    The number of bytes in the file's resource fork.
  1500.     
  1501.     Result Codes
  1502.         noErr                0        No error
  1503.         nsvErr                -35        No such volume
  1504.         ioErr                -36        I/O error
  1505.         bdNamErr            -37        Bad filename
  1506.         fnfErr                -43        File not found
  1507.         paramErr            -50        No default volume
  1508.         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
  1509.         afpAccessDenied        -5000    User does not have the correct access
  1510.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1511.     
  1512.     __________
  1513.     
  1514.     See also:    GetFileSize
  1515. */
  1516.  
  1517. /*****************************************************************************/
  1518.  
  1519. pascal    OSErr    BumpDate(short vRefNum,
  1520.                          long dirID,
  1521.                          ConstStr255Param name);
  1522. /*    ¶ Update the modification date of a file or directory.
  1523.     The BumpDate function changes the modification date of a file or
  1524.     directory to the current date/time.  If the modification date is already
  1525.     equal to the current date/time, then add one second to the
  1526.     modification date.
  1527.     
  1528.     vRefNum    input:    Volume specification.
  1529.     dirID    input:    Directory ID.
  1530.     name    input:    Pointer to object name, or nil when dirID specifies
  1531.                     a directory that's the object.
  1532.     
  1533.     Result Codes
  1534.         noErr                0        No error
  1535.         nsvErr                -35        No such volume
  1536.         ioErr                -36        I/O error
  1537.         bdNamErr            -37        Bad filename
  1538.         fnfErr                -43        File not found
  1539.         fLckdErr            -45        File is locked
  1540.         vLckdErr            -46        Volume is locked or read-only
  1541.         paramErr            -50        No default volume
  1542.         dirNFErr            -120    Directory not found or incomplete pathname
  1543.         afpAccessDenied        -5000    User does not have the correct access
  1544.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1545.     
  1546.     __________
  1547.     
  1548.     See also:    FSpBumpDate
  1549. */
  1550.  
  1551. /*****************************************************************************/
  1552.  
  1553. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  1554. /*    ¶ Update the modification date of a file or directory.
  1555.     The FSpBumpDate function changes the modification date of a file or
  1556.     directory to the current date/time.  If the modification date is already
  1557.     equal to the current date/time, then add one second to the
  1558.     modification date.
  1559.     
  1560.     spec    input:    An FSSpec record specifying the object.
  1561.     
  1562.     Result Codes
  1563.         noErr                0        No error
  1564.         nsvErr                -35        No such volume
  1565.         ioErr                -36        I/O error
  1566.         bdNamErr            -37        Bad filename
  1567.         fnfErr                -43        File not found
  1568.         fLckdErr            -45        File is locked
  1569.         vLckdErr            -46        Volume is locked or read-only
  1570.         paramErr            -50        No default volume
  1571.         dirNFErr            -120    Directory not found or incomplete pathname
  1572.         afpAccessDenied        -5000    User does not have the correct access
  1573.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1574.     
  1575.     __________
  1576.     
  1577.     See also:    BumpDate
  1578. */
  1579.  
  1580. /*****************************************************************************/
  1581.  
  1582. pascal    OSErr    ChangeCreatorType(short vRefNum,
  1583.                                   long dirID,
  1584.                                   ConstStr255Param name,
  1585.                                   OSType creator,
  1586.                                   OSType fileType);
  1587. /*    ¶ Change the creator or file type of a file.
  1588.     The ChangeCreatorType function changes the creator or file type of a file.
  1589.  
  1590.     vRefNum        input:    Volume specification.
  1591.     dirID        input:    Directory ID.
  1592.     name        input:    The name of the file.
  1593.     creator        input:    The new creator type or 0x00000000 to leave
  1594.                         the creator type alone.
  1595.     fileType    input:    The new file type or 0x00000000 to leave the
  1596.                         file type alone.
  1597.     
  1598.     Result Codes
  1599.         noErr                0        No error
  1600.         nsvErr                -35        No such volume
  1601.         ioErr                -36        I/O error
  1602.         bdNamErr            -37        Bad filename
  1603.         fnfErr                -43        File not found
  1604.         fLckdErr            -45        File is locked
  1605.         vLckdErr            -46        Volume is locked or read-only
  1606.         paramErr            -50        No default volume
  1607.         dirNFErr            -120    Directory not found or incomplete pathname
  1608.         notAFileErr            -1302    Name was not a file
  1609.         afpAccessDenied        -5000    User does not have the correct access
  1610.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1611.     
  1612.     __________
  1613.     
  1614.     See also:    FSpChangeCreatorType
  1615. */
  1616.  
  1617. /*****************************************************************************/
  1618.  
  1619. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  1620.                                      OSType creator,
  1621.                                      OSType fileType);
  1622. /*    ¶ Change the creator or file type of a file.
  1623.     The FSpChangeCreatorType function changes the creator or file type of a file.
  1624.  
  1625.     spec        input:    An FSSpec record specifying the file.
  1626.     creator        input:    The new creator type or 0x00000000 to leave
  1627.                         the creator type alone.
  1628.     fileType    input:    The new file type or 0x00000000 to leave the
  1629.                         file type alone.
  1630.     
  1631.     Result Codes
  1632.         noErr                0        No error
  1633.         nsvErr                -35        No such volume
  1634.         ioErr                -36        I/O error
  1635.         bdNamErr            -37        Bad filename
  1636.         fnfErr                -43        File not found
  1637.         fLckdErr            -45        File is locked
  1638.         vLckdErr            -46        Volume is locked or read-only
  1639.         paramErr            -50        No default volume
  1640.         dirNFErr            -120    Directory not found or incomplete pathname
  1641.         notAFileErr            -1302    Name was not a file
  1642.         afpAccessDenied        -5000    User does not have the correct access
  1643.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1644.     
  1645.     __________
  1646.     
  1647.     See also:    ChangeCreatorType
  1648. */
  1649.  
  1650. /*****************************************************************************/
  1651.  
  1652. pascal    OSErr    ChangeFDFlags(short vRefNum,
  1653.                               long dirID,
  1654.                               ConstStr255Param name,
  1655.                               Boolean    setBits,
  1656.                               unsigned short flagBits);
  1657. /*    ¶ Set or clear Finder Flag bits.
  1658.     The ChangeFDFlags function sets or clears Finder Flag bits in the
  1659.     fdFlags field of a file or directory's FInfo record.
  1660.     
  1661.     vRefNum        input:    Volume specification.
  1662.     dirID        input:    Directory ID.
  1663.     name        input:    Pointer to object name, or nil when dirID specifies
  1664.                         a directory that's the object.
  1665.     setBits        input:    If true, then set the bits specified in flagBits.
  1666.                         If false, then clear the bits specified in flagBits.
  1667.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  1668.                         bits to set or clear. If a bit in flagBits is set,
  1669.                         then the same bit in fdFlags is either set or
  1670.                         cleared depending on the state of the setBits
  1671.                         parameter.
  1672.     
  1673.     Result Codes
  1674.         noErr                0        No error
  1675.         nsvErr                -35        No such volume
  1676.         ioErr                -36        I/O error
  1677.         bdNamErr            -37        Bad filename
  1678.         fnfErr                -43        File not found
  1679.         fLckdErr            -45        File is locked
  1680.         vLckdErr            -46        Volume is locked or read-only
  1681.         paramErr            -50        No default volume
  1682.         dirNFErr            -120    Directory not found or incomplete pathname
  1683.         afpAccessDenied        -5000    User does not have the correct access
  1684.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1685.     
  1686.     __________
  1687.     
  1688.     See also:    FSpChangeFDFlags
  1689. */
  1690.  
  1691. /*****************************************************************************/
  1692.  
  1693. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  1694.                                  Boolean setBits,
  1695.                                  unsigned short flagBits);
  1696. /*    ¶ Set or clear Finder Flag bits.
  1697.     The FSpChangeFDFlags function sets or clears Finder Flag bits in the
  1698.     fdFlags field of a file or directory's FInfo record.
  1699.     
  1700.     spec        input:    An FSSpec record specifying the object.
  1701.     setBits        input:    If true, then set the bits specified in flagBits.
  1702.                         If false, then clear the bits specified in flagBits.
  1703.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  1704.                         bits to set or clear. If a bit in flagBits is set,
  1705.                         then the same bit in fdFlags is either set or
  1706.                         cleared depending on the state of the setBits
  1707.                         parameter.
  1708.     
  1709.     Result Codes
  1710.         noErr                0        No error
  1711.         nsvErr                -35        No such volume
  1712.         ioErr                -36        I/O error
  1713.         bdNamErr            -37        Bad filename
  1714.         fnfErr                -43        File not found
  1715.         fLckdErr            -45        File is locked
  1716.         vLckdErr            -46        Volume is locked or read-only
  1717.         paramErr            -50        No default volume
  1718.         dirNFErr            -120    Directory not found or incomplete pathname
  1719.         afpAccessDenied        -5000    User does not have the correct access
  1720.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1721.     
  1722.     __________
  1723.     
  1724.     See also:    ChangeFDFlags
  1725. */
  1726.  
  1727. /*****************************************************************************/
  1728.  
  1729. pascal    OSErr    SetIsInvisible(short vRefNum,
  1730.                                long dirID,
  1731.                                ConstStr255Param name);
  1732. /*    ¶ Set the invisible Finder Flag bit.
  1733.     The SetIsInvisible function sets the invisible bit in the fdFlags
  1734.     word of the specified file or directory's finder information.
  1735.     
  1736.     vRefNum    input:    Volume specification.
  1737.     dirID    input:    Directory ID.
  1738.     name    input:    Pointer to object name, or nil when dirID specifies
  1739.                     a directory that's the object.
  1740.     
  1741.     Result Codes
  1742.         noErr                0        No error
  1743.         nsvErr                -35        No such volume
  1744.         ioErr                -36        I/O error
  1745.         bdNamErr            -37        Bad filename
  1746.         fnfErr                -43        File not found
  1747.         fLckdErr            -45        File is locked
  1748.         vLckdErr            -46        Volume is locked or read-only
  1749.         paramErr            -50        No default volume
  1750.         dirNFErr            -120    Directory not found or incomplete pathname
  1751.         afpAccessDenied        -5000    User does not have the correct access
  1752.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1753.     
  1754.     __________
  1755.     
  1756.     See also:    FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  1757. */
  1758.  
  1759. /*****************************************************************************/
  1760.  
  1761. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  1762. /*    ¶ Set the invisible Finder Flag bit.
  1763.     The FSpSetIsInvisible function sets the invisible bit in the fdFlags
  1764.     word of the specified file or directory's finder information.
  1765.     
  1766.     spec    input:    An FSSpec record specifying the object.
  1767.     
  1768.     Result Codes
  1769.         noErr                0        No error
  1770.         nsvErr                -35        No such volume
  1771.         ioErr                -36        I/O error
  1772.         bdNamErr            -37        Bad filename
  1773.         fnfErr                -43        File not found
  1774.         fLckdErr            -45        File is locked
  1775.         vLckdErr            -46        Volume is locked or read-only
  1776.         paramErr            -50        No default volume
  1777.         dirNFErr            -120    Directory not found or incomplete pathname
  1778.         afpAccessDenied        -5000    User does not have the correct access
  1779.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1780.     
  1781.     __________
  1782.     
  1783.     See also:    SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  1784. */
  1785.  
  1786. /*****************************************************************************/
  1787.  
  1788. pascal    OSErr    ClearIsInvisible(short vRefNum,
  1789.                                  long dirID,
  1790.                                  ConstStr255Param name);
  1791. /*    ¶ Clear the invisible Finder Flag bit.
  1792.     The ClearIsInvisible function clears the invisible bit in the fdFlags
  1793.     word of the specified file or directory's finder information.
  1794.     
  1795.     vRefNum    input:    Volume specification.
  1796.     dirID    input:    Directory ID.
  1797.     name    input:    Pointer to object name, or nil when dirID specifies
  1798.                     a directory that's the object.
  1799.     
  1800.     Result Codes
  1801.         noErr                0        No error
  1802.         nsvErr                -35        No such volume
  1803.         ioErr                -36        I/O error
  1804.         bdNamErr            -37        Bad filename
  1805.         fnfErr                -43        File not found
  1806.         fLckdErr            -45        File is locked
  1807.         vLckdErr            -46        Volume is locked or read-only
  1808.         paramErr            -50        No default volume
  1809.         dirNFErr            -120    Directory not found or incomplete pathname
  1810.         afpAccessDenied        -5000    User does not have the correct access
  1811.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1812.     
  1813.     __________
  1814.     
  1815.     See also:    SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
  1816. */
  1817.  
  1818. /*****************************************************************************/
  1819.  
  1820. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  1821. /*    ¶ Clear the invisible Finder Flag bit.
  1822.     The FSpClearIsInvisible function clears the invisible bit in the fdFlags
  1823.     word of the specified file or directory's finder information.
  1824.     
  1825.     spec    input:    An FSSpec record specifying the object.
  1826.     
  1827.     Result Codes
  1828.         noErr                0        No error
  1829.         nsvErr                -35        No such volume
  1830.         ioErr                -36        I/O error
  1831.         bdNamErr            -37        Bad filename
  1832.         fnfErr                -43        File not found
  1833.         fLckdErr            -45        File is locked
  1834.         vLckdErr            -46        Volume is locked or read-only
  1835.         paramErr            -50        No default volume
  1836.         dirNFErr            -120    Directory not found or incomplete pathname
  1837.         afpAccessDenied        -5000    User does not have the correct access
  1838.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1839.     
  1840.     __________
  1841.     
  1842.     See also:    SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
  1843. */
  1844.  
  1845. /*****************************************************************************/
  1846.  
  1847. pascal    OSErr    SetNameLocked(short vRefNum,
  1848.                               long dirID,
  1849.                               ConstStr255Param name);
  1850. /*    ¶ Set the nameLocked Finder Flag bit.
  1851.     The SetNameLocked function sets the nameLocked bit in the fdFlags word
  1852.     of the specified file or directory's finder information.
  1853.     
  1854.     vRefNum    input:    Volume specification.
  1855.     dirID    input:    Directory ID.
  1856.     name    input:    Pointer to object name, or nil when dirID specifies
  1857.                     a directory that's the object.
  1858.     
  1859.     Result Codes
  1860.         noErr                0        No error
  1861.         nsvErr                -35        No such volume
  1862.         ioErr                -36        I/O error
  1863.         bdNamErr            -37        Bad filename
  1864.         fnfErr                -43        File not found
  1865.         fLckdErr            -45        File is locked
  1866.         vLckdErr            -46        Volume is locked or read-only
  1867.         paramErr            -50        No default volume
  1868.         dirNFErr            -120    Directory not found or incomplete pathname
  1869.         afpAccessDenied        -5000    User does not have the correct access
  1870.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1871.     
  1872.     __________
  1873.     
  1874.     See also:    FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
  1875. */
  1876.  
  1877. /*****************************************************************************/
  1878.  
  1879. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  1880. /*    ¶ Set the nameLocked Finder Flag bit.
  1881.     The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
  1882.     of the specified file or directory's finder information.
  1883.     
  1884.     spec    input:    An FSSpec record specifying the object.
  1885.     
  1886.     Result Codes
  1887.         noErr                0        No error
  1888.         nsvErr                -35        No such volume
  1889.         ioErr                -36        I/O error
  1890.         bdNamErr            -37        Bad filename
  1891.         fnfErr                -43        File not found
  1892.         fLckdErr            -45        File is locked
  1893.         vLckdErr            -46        Volume is locked or read-only
  1894.         paramErr            -50        No default volume
  1895.         dirNFErr            -120    Directory not found or incomplete pathname
  1896.         afpAccessDenied        -5000    User does not have the correct access
  1897.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1898.     
  1899.     __________
  1900.     
  1901.     See also:    SetNameLocked, ClearNameLocked, FSpClearNameLocked
  1902. */
  1903.  
  1904. /*****************************************************************************/
  1905.  
  1906. pascal    OSErr    ClearNameLocked(short vRefNum,
  1907.                                 long dirID,
  1908.                                 ConstStr255Param name);
  1909. /*    ¶ Clear the nameLocked Finder Flag bit.
  1910.     The ClearNameLocked function clears the nameLocked bit in the fdFlags
  1911.     word of the specified file or directory's finder information.
  1912.     
  1913.     vRefNum    input:    Volume specification.
  1914.     dirID    input:    Directory ID.
  1915.     name    input:    Pointer to object name, or nil when dirID specifies
  1916.                     a directory that's the object.
  1917.     
  1918.     Result Codes
  1919.         noErr                0        No error
  1920.         nsvErr                -35        No such volume
  1921.         ioErr                -36        I/O error
  1922.         bdNamErr            -37        Bad filename
  1923.         fnfErr                -43        File not found
  1924.         fLckdErr            -45        File is locked
  1925.         vLckdErr            -46        Volume is locked or read-only
  1926.         paramErr            -50        No default volume
  1927.         dirNFErr            -120    Directory not found or incomplete pathname
  1928.         afpAccessDenied        -5000    User does not have the correct access
  1929.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1930.     
  1931.     __________
  1932.     
  1933.     See also:    SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
  1934. */
  1935.  
  1936. /*****************************************************************************/
  1937.  
  1938. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  1939. /*    ¶ Clear the nameLocked Finder Flag bit.
  1940.     The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
  1941.     word of the specified file or directory's finder information.
  1942.     
  1943.     spec    input:    An FSSpec record specifying the object.
  1944.     
  1945.     Result Codes
  1946.         noErr                0        No error
  1947.         nsvErr                -35        No such volume
  1948.         ioErr                -36        I/O error
  1949.         bdNamErr            -37        Bad filename
  1950.         fnfErr                -43        File not found
  1951.         fLckdErr            -45        File is locked
  1952.         vLckdErr            -46        Volume is locked or read-only
  1953.         paramErr            -50        No default volume
  1954.         dirNFErr            -120    Directory not found or incomplete pathname
  1955.         afpAccessDenied        -5000    User does not have the correct access
  1956.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1957.     
  1958.     __________
  1959.     
  1960.     See also:    SetNameLocked, FSpSetNameLocked, ClearNameLocked
  1961. */
  1962.  
  1963. /*****************************************************************************/
  1964.  
  1965. pascal    OSErr    SetIsStationery(short vRefNum,
  1966.                                 long dirID,
  1967.                                 ConstStr255Param name);
  1968. /*    ¶ Set the isStationery Finder Flag bit.
  1969.     The SetIsStationery function sets the isStationery bit in the
  1970.     fdFlags word of the specified file or directory's finder information.
  1971.     
  1972.     vRefNum    input:    Volume specification.
  1973.     dirID    input:    Directory ID.
  1974.     name    input:    Pointer to object name, or nil when dirID specifies
  1975.                     a directory that's the object.
  1976.     
  1977.     Result Codes
  1978.         noErr                0        No error
  1979.         nsvErr                -35        No such volume
  1980.         ioErr                -36        I/O error
  1981.         bdNamErr            -37        Bad filename
  1982.         fnfErr                -43        File not found
  1983.         fLckdErr            -45        File is locked
  1984.         vLckdErr            -46        Volume is locked or read-only
  1985.         paramErr            -50        No default volume
  1986.         dirNFErr            -120    Directory not found or incomplete pathname
  1987.         afpAccessDenied        -5000    User does not have the correct access
  1988.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1989.     
  1990.     __________
  1991.     
  1992.     See also:    FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
  1993. */
  1994.  
  1995. /*****************************************************************************/
  1996.  
  1997. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  1998. /*    ¶ Set the isStationery Finder Flag bit.
  1999.     The FSpSetIsStationery function sets the isStationery bit in the
  2000.     fdFlags word of the specified file or directory's finder information.
  2001.     
  2002.     spec    input:    An FSSpec record specifying the object.
  2003.     
  2004.     Result Codes
  2005.         noErr                0        No error
  2006.         nsvErr                -35        No such volume
  2007.         ioErr                -36        I/O error
  2008.         bdNamErr            -37        Bad filename
  2009.         fnfErr                -43        File not found
  2010.         fLckdErr            -45        File is locked
  2011.         vLckdErr            -46        Volume is locked or read-only
  2012.         paramErr            -50        No default volume
  2013.         dirNFErr            -120    Directory not found or incomplete pathname
  2014.         afpAccessDenied        -5000    User does not have the correct access
  2015.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2016.     
  2017.     __________
  2018.     
  2019.     See also:    SetIsStationery, ClearIsStationery, FSpClearIsStationery
  2020. */
  2021.  
  2022. /*****************************************************************************/
  2023.  
  2024. pascal    OSErr    ClearIsStationery(short vRefNum,
  2025.                                   long dirID,
  2026.                                   ConstStr255Param name);
  2027. /*    ¶ Clear the isStationery Finder Flag bit.
  2028.     The ClearIsStationery function clears the isStationery bit in the
  2029.     fdFlags word of the specified file or directory's finder information.
  2030.     
  2031.     vRefNum    input:    Volume specification.
  2032.     dirID    input:    Directory ID.
  2033.     name    input:    Pointer to object name, or nil when dirID specifies
  2034.                     a directory that's the object.
  2035.     
  2036.     Result Codes
  2037.         noErr                0        No error
  2038.         nsvErr                -35        No such volume
  2039.         ioErr                -36        I/O error
  2040.         bdNamErr            -37        Bad filename
  2041.         fnfErr                -43        File not found
  2042.         fLckdErr            -45        File is locked
  2043.         vLckdErr            -46        Volume is locked or read-only
  2044.         paramErr            -50        No default volume
  2045.         dirNFErr            -120    Directory not found or incomplete pathname
  2046.         afpAccessDenied        -5000    User does not have the correct access
  2047.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2048.     
  2049.     __________
  2050.     
  2051.     See also:    SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
  2052. */
  2053.  
  2054. /*****************************************************************************/
  2055.  
  2056. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  2057. /*    ¶ Clear the isStationery Finder Flag bit.
  2058.     The FSpClearIsStationery function clears the isStationery bit in the
  2059.     fdFlags word of the specified file or directory's finder information.
  2060.     
  2061.     spec    input:    An FSSpec record specifying the object.
  2062.     
  2063.     Result Codes
  2064.         noErr                0        No error
  2065.         nsvErr                -35        No such volume
  2066.         ioErr                -36        I/O error
  2067.         bdNamErr            -37        Bad filename
  2068.         fnfErr                -43        File not found
  2069.         fLckdErr            -45        File is locked
  2070.         vLckdErr            -46        Volume is locked or read-only
  2071.         paramErr            -50        No default volume
  2072.         dirNFErr            -120    Directory not found or incomplete pathname
  2073.         afpAccessDenied        -5000    User does not have the correct access
  2074.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2075.     
  2076.     __________
  2077.     
  2078.     See also:    SetIsStationery, FSpSetIsStationery, ClearIsStationery
  2079. */
  2080.  
  2081. /*****************************************************************************/
  2082.  
  2083. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  2084.                                  long dirID,
  2085.                                  ConstStr255Param name);
  2086. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  2087.     The SetHasCustomIcon function sets the hasCustomIcon bit in the
  2088.     fdFlags word of the specified file or directory's finder information.
  2089.     
  2090.     vRefNum    input:    Volume specification.
  2091.     dirID    input:    Directory ID.
  2092.     name    input:    Pointer to object name, or nil when dirID specifies
  2093.                     a directory that's the object.
  2094.     
  2095.     Result Codes
  2096.         noErr                0        No error
  2097.         nsvErr                -35        No such volume
  2098.         ioErr                -36        I/O error
  2099.         bdNamErr            -37        Bad filename
  2100.         fnfErr                -43        File not found
  2101.         fLckdErr            -45        File is locked
  2102.         vLckdErr            -46        Volume is locked or read-only
  2103.         paramErr            -50        No default volume
  2104.         dirNFErr            -120    Directory not found or incomplete pathname
  2105.         afpAccessDenied        -5000    User does not have the correct access
  2106.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2107.     
  2108.     __________
  2109.     
  2110.     See also:    FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  2111. */
  2112.  
  2113. /*****************************************************************************/
  2114.  
  2115. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  2116. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  2117.     The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
  2118.     fdFlags word of the specified file or directory's finder information.
  2119.     
  2120.     spec    input:    An FSSpec record specifying the object.
  2121.     
  2122.     Result Codes
  2123.         noErr                0        No error
  2124.         nsvErr                -35        No such volume
  2125.         ioErr                -36        I/O error
  2126.         bdNamErr            -37        Bad filename
  2127.         fnfErr                -43        File not found
  2128.         fLckdErr            -45        File is locked
  2129.         vLckdErr            -46        Volume is locked or read-only
  2130.         paramErr            -50        No default volume
  2131.         dirNFErr            -120    Directory not found or incomplete pathname
  2132.         afpAccessDenied        -5000    User does not have the correct access
  2133.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2134.     
  2135.     __________
  2136.     
  2137.     See also:    SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  2138. */
  2139.  
  2140. /*****************************************************************************/
  2141.  
  2142. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  2143.                                    long dirID,
  2144.                                    ConstStr255Param name);
  2145. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  2146.     The ClearHasCustomIcon function clears the hasCustomIcon bit in the
  2147.     fdFlags word of the specified file or directory's finder information.
  2148.     
  2149.     vRefNum    input:    Volume specification.
  2150.     dirID    input:    Directory ID.
  2151.     name    input:    Pointer to object name, or nil when dirID specifies
  2152.                     a directory that's the object.
  2153.     
  2154.     Result Codes
  2155.         noErr                0        No error
  2156.         nsvErr                -35        No such volume
  2157.         ioErr                -36        I/O error
  2158.         bdNamErr            -37        Bad filename
  2159.         fnfErr                -43        File not found
  2160.         fLckdErr            -45        File is locked
  2161.         vLckdErr            -46        Volume is locked or read-only
  2162.         paramErr            -50        No default volume
  2163.         dirNFErr            -120    Directory not found or incomplete pathname
  2164.         afpAccessDenied        -5000    User does not have the correct access
  2165.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2166.     
  2167.     __________
  2168.     
  2169.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
  2170. */
  2171.  
  2172. /*****************************************************************************/
  2173.  
  2174. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  2175. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  2176.     The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
  2177.     fdFlags word of the specified file or directory's finder information.
  2178.     
  2179.     spec    input:    An FSSpec record specifying the object.
  2180.     
  2181.     Result Codes
  2182.         noErr                0        No error
  2183.         nsvErr                -35        No such volume
  2184.         ioErr                -36        I/O error
  2185.         bdNamErr            -37        Bad filename
  2186.         fnfErr                -43        File not found
  2187.         fLckdErr            -45        File is locked
  2188.         vLckdErr            -46        Volume is locked or read-only
  2189.         paramErr            -50        No default volume
  2190.         dirNFErr            -120    Directory not found or incomplete pathname
  2191.         afpAccessDenied        -5000    User does not have the correct access
  2192.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2193.     
  2194.     __________
  2195.     
  2196.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
  2197. */
  2198.  
  2199. /*****************************************************************************/
  2200.  
  2201. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  2202.                                    long dirID,
  2203.                                    ConstStr255Param name);
  2204. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  2205.     The ClearHasBeenInited function clears the hasBeenInited bit in the
  2206.     fdFlags word of the specified file or directory's finder information.
  2207.     
  2208.     vRefNum    input:    Volume specification.
  2209.     dirID    input:    Directory ID.
  2210.     name    input:    Pointer to object name, or nil when dirID specifies
  2211.                     a directory that's the object.
  2212.     
  2213.     Result Codes
  2214.         noErr                0        No error
  2215.         nsvErr                -35        No such volume
  2216.         ioErr                -36        I/O error
  2217.         bdNamErr            -37        Bad filename
  2218.         fnfErr                -43        File not found
  2219.         fLckdErr            -45        File is locked
  2220.         vLckdErr            -46        Volume is locked or read-only
  2221.         paramErr            -50        No default volume
  2222.         dirNFErr            -120    Directory not found or incomplete pathname
  2223.         afpAccessDenied        -5000    User does not have the correct access
  2224.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2225.     
  2226.     __________
  2227.     
  2228.     See also:    FSpClearHasBeenInited
  2229. */
  2230.  
  2231. /*****************************************************************************/
  2232.  
  2233. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  2234. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  2235.     The FSpClearHasBeenInited function clears the hasBeenInited bit in the
  2236.     fdFlags word of the specified file or directory's finder information.
  2237.     
  2238.     spec    input:    An FSSpec record specifying the object.
  2239.     
  2240.     Result Codes
  2241.         noErr                0        No error
  2242.         nsvErr                -35        No such volume
  2243.         ioErr                -36        I/O error
  2244.         bdNamErr            -37        Bad filename
  2245.         fnfErr                -43        File not found
  2246.         fLckdErr            -45        File is locked
  2247.         vLckdErr            -46        Volume is locked or read-only
  2248.         paramErr            -50        No default volume
  2249.         dirNFErr            -120    Directory not found or incomplete pathname
  2250.         afpAccessDenied        -5000    User does not have the correct access
  2251.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2252.     
  2253.     __________
  2254.     
  2255.     See also:    ClearHasBeenInited
  2256. */
  2257.  
  2258. /*****************************************************************************/
  2259.  
  2260. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  2261.                                       long srcDirID,
  2262.                                       ConstStr255Param srcName,
  2263.                                       short dstVRefNum,
  2264.                                       long dstDirID,
  2265.                                       ConstStr255Param dstName,
  2266.                                       Boolean copyLockBit);
  2267. /*    ¶ Copy all File Manager attributes from the source to the destination.
  2268.     The CopyFileMgrAttributes function copies all File Manager attributes
  2269.     from the source file or directory to the destination file or directory.
  2270.     If copyLockBit is true, then set the locked state of the destination
  2271.     to match the source.
  2272.  
  2273.     srcVRefNum    input:    Source volume specification.
  2274.     srcDirID    input:    Source directory ID.
  2275.     srcName        input:    Pointer to source object name, or nil when
  2276.                         srcDirID specifies a directory that's the object.
  2277.     dstVRefNum    input:    Destination volume specification.
  2278.     dstDirID    input:    Destination directory ID.
  2279.     dstName        input:    Pointer to destination object name, or nil when
  2280.                         dstDirID specifies a directory that's the object.
  2281.     copyLockBit    input:    If true, set the locked state of the destination
  2282.                         to match the source.
  2283.     
  2284.     Result Codes
  2285.         noErr                0        No error
  2286.         nsvErr                -35        No such volume
  2287.         ioErr                -36        I/O error
  2288.         bdNamErr            -37        Bad filename
  2289.         fnfErr                -43        File not found
  2290.         fLckdErr            -45        File is locked
  2291.         vLckdErr            -46        Volume is locked or read-only
  2292.         paramErr            -50        No default volume
  2293.         dirNFErr            -120    Directory not found or incomplete pathname
  2294.         afpAccessDenied        -5000    User does not have the correct access
  2295.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2296.     
  2297.     __________
  2298.     
  2299.     See also:    FSpCopyFileMgrAttributes
  2300. */
  2301.  
  2302. /*****************************************************************************/
  2303.  
  2304. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  2305.                                          const FSSpec *dstSpec,
  2306.                                          Boolean copyLockBit);
  2307. /*    ¶ Copy all File Manager attributes from the source to the destination.
  2308.     The FSpCopyFileMgrAttributes function copies all File Manager attributes
  2309.     from the source file or directory to the destination file or directory.
  2310.     If copyLockBit is true, then set the locked state of the destination
  2311.     to match the source.
  2312.  
  2313.     srcSpec        input:    An FSSpec record specifying the source object.
  2314.     dstSpec        input:    An FSSpec record specifying the destination object.
  2315.     copyLockBit    input:    If true, set the locked state of the destination
  2316.                         to match the source.
  2317.     
  2318.     Result Codes
  2319.         noErr                0        No error
  2320.         nsvErr                -35        No such volume
  2321.         ioErr                -36        I/O error
  2322.         bdNamErr            -37        Bad filename
  2323.         fnfErr                -43        File not found
  2324.         fLckdErr            -45        File is locked
  2325.         vLckdErr            -46        Volume is locked or read-only
  2326.         paramErr            -50        No default volume
  2327.         dirNFErr            -120    Directory not found or incomplete pathname
  2328.         afpAccessDenied        -5000    User does not have the correct access
  2329.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2330.     
  2331.     __________
  2332.     
  2333.     See also:    CopyFileMgrAttributes
  2334. */
  2335.  
  2336. /*****************************************************************************/
  2337.  
  2338. pascal    OSErr    HOpenAware(short vRefNum,
  2339.                            long dirID,
  2340.                            ConstStr255Param fileName,
  2341.                            short denyModes,
  2342.                            short *refNum);
  2343. /*    ¶ Open the data fork of a file using deny mode permissions.
  2344.     The HOpenAware function opens the data fork of a file using deny mode
  2345.     permissions instead the normal File Manager permissions.  If OpenDeny
  2346.     is not available, then HOpenAware translates the deny modes to the
  2347.     closest File Manager permissions and tries to open the file with
  2348.     OpenDF first, and then Open if OpenDF isn't available. By using
  2349.     HOpenAware with deny mode permissions, a program can be "AppleShare
  2350.     aware" and fall back on the standard File Manager open calls
  2351.     automatically.
  2352.  
  2353.     vRefNum        input:    Volume specification.
  2354.     dirID        input:    Directory ID.
  2355.     fileName    input:    The name of the file.
  2356.     denyModes    input:    The deny modes access under which to open the file.
  2357.     refNum        output:    The file reference number of the opened file.
  2358.     
  2359.     Result Codes
  2360.         noErr                0        No error
  2361.         nsvErr                -35        No such volume
  2362.         tmfoErr                -42        Too many files open
  2363.         fnfErr                -43        File not found
  2364.         wPrErr                -44        Volume locked by hardware
  2365.         fLckdErr            -45        File is locked
  2366.         vLckdErr            -46        Volume is locked or read-only
  2367.         opWrErr                -49        File already open for writing
  2368.         paramErr            -50        No default volume
  2369.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2370.         afpAccessDenied        -5000    User does not have the correct access to the file
  2371.         afpDenyConflict        -5006    Requested access permission not possible
  2372.     
  2373.     __________
  2374.     
  2375.     See also:    FSpOpenAware, HOpenRFAware, FSpOpenRFAware
  2376. */
  2377.  
  2378. /*****************************************************************************/
  2379.  
  2380. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  2381.                              short denyModes,
  2382.                              short *refNum);
  2383. /*    ¶ Open the data fork of a file using deny mode permissions.
  2384.     The FSpOpenAware function opens the data fork of a file using deny mode
  2385.     permissions instead the normal File Manager permissions.  If OpenDeny
  2386.     is not available, then FSpOpenAware translates the deny modes to the
  2387.     closest File Manager permissions and tries to open the file with
  2388.     OpenDF first, and then Open if OpenDF isn't available. By using
  2389.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  2390.     aware" and fall back on the standard File Manager open calls
  2391.     automatically.
  2392.  
  2393.     spec        input:    An FSSpec record specifying the file.
  2394.     denyModes    input:    The deny modes access under which to open the file.
  2395.     refNum        output:    The file reference number of the opened file.
  2396.     
  2397.     Result Codes
  2398.         noErr                0        No error
  2399.         nsvErr                -35        No such volume
  2400.         tmfoErr                -42        Too many files open
  2401.         fnfErr                -43        File not found
  2402.         wPrErr                -44        Volume locked by hardware
  2403.         fLckdErr            -45        File is locked
  2404.         vLckdErr            -46        Volume is locked or read-only
  2405.         opWrErr                -49        File already open for writing
  2406.         paramErr            -50        No default volume
  2407.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2408.         afpAccessDenied        -5000    User does not have the correct access to the file
  2409.         afpDenyConflict        -5006    Requested access permission not possible
  2410.     
  2411.     __________
  2412.     
  2413.     See also:    HOpenAware, HOpenRFAware, FSpOpenRFAware
  2414. */
  2415.  
  2416. /*****************************************************************************/
  2417.  
  2418. pascal    OSErr    HOpenRFAware(short vRefNum,
  2419.                              long dirID,
  2420.                              ConstStr255Param fileName,
  2421.                              short denyModes,
  2422.                              short *refNum);
  2423. /*    ¶ Open the resource fork of a file using deny mode permissions.
  2424.     The HOpenRFAware function opens the resource fork of a file using deny
  2425.     mode permissions instead the normal File Manager permissions.  If
  2426.     OpenRFDeny is not available, then HOpenRFAware translates the deny
  2427.     modes to the closest File Manager permissions and tries to open the
  2428.     file with OpenRF. By using HOpenRFAware with deny mode permissions,
  2429.     a program can be "AppleShare aware" and fall back on the standard
  2430.     File Manager open calls automatically.
  2431.  
  2432.     vRefNum        input:    Volume specification.
  2433.     dirID        input:    Directory ID.
  2434.     fileName    input:    The name of the file.
  2435.     denyModes    input:    The deny modes access under which to open the file.
  2436.     refNum        output:    The file reference number of the opened file.
  2437.     
  2438.     Result Codes
  2439.         noErr                0        No error
  2440.         nsvErr                -35        No such volume
  2441.         tmfoErr                -42        Too many files open
  2442.         fnfErr                -43        File not found
  2443.         wPrErr                -44        Volume locked by hardware
  2444.         fLckdErr            -45        File is locked
  2445.         vLckdErr            -46        Volume is locked or read-only
  2446.         opWrErr                -49        File already open for writing
  2447.         paramErr            -50        No default volume
  2448.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2449.         afpAccessDenied        -5000    User does not have the correct access to the file
  2450.         afpDenyConflict        -5006    Requested access permission not possible
  2451.     
  2452.     __________
  2453.     
  2454.     See also:    HOpenAware, FSpOpenAware, FSpOpenRFAware
  2455. */
  2456.  
  2457. /*****************************************************************************/
  2458.  
  2459. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  2460.                                short denyModes,
  2461.                                short *refNum);
  2462. /*    ¶ Open the resource fork of a file using deny mode permissions.
  2463.     The FSpOpenRFAware function opens the resource fork of a file using deny
  2464.     mode permissions instead the normal File Manager permissions.  If
  2465.     OpenRFDeny is not available, then FSpOpenRFAware translates the deny
  2466.     modes to the closest File Manager permissions and tries to open the
  2467.     file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
  2468.     a program can be "AppleShare aware" and fall back on the standard
  2469.     File Manager open calls automatically.
  2470.  
  2471.     spec        input:    An FSSpec record specifying the file.
  2472.     denyModes    input:    The deny modes access under which to open the file.
  2473.     refNum        output:    The file reference number of the opened file.
  2474.     
  2475.     Result Codes
  2476.         noErr                0        No error
  2477.         nsvErr                -35        No such volume
  2478.         tmfoErr                -42        Too many files open
  2479.         fnfErr                -43        File not found
  2480.         wPrErr                -44        Volume locked by hardware
  2481.         fLckdErr            -45        File is locked
  2482.         vLckdErr            -46        Volume is locked or read-only
  2483.         opWrErr                -49        File already open for writing
  2484.         paramErr            -50        No default volume
  2485.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2486.         afpAccessDenied        -5000    User does not have the correct access to the file
  2487.         afpDenyConflict        -5006    Requested access permission not possible
  2488.     
  2489.     __________
  2490.     
  2491.     See also:    HOpenAware, FSpOpenAware, HOpenRFAware
  2492. */
  2493.  
  2494. /*****************************************************************************/
  2495.  
  2496. pascal    OSErr    FSReadNoCache(short refNum,
  2497.                               long *count,
  2498.                               void *buffPtr);
  2499. /*    ¶ Read any number of bytes from an open file requesting no caching.
  2500.     The FSReadNoCache function reads any number of bytes from an open file
  2501.     while asking the file system to bypass its cache mechanism.
  2502.     
  2503.     refNum    input:    The file reference number of an open file.
  2504.     count    input:    The number of bytes to read.
  2505.             output:    The number of bytes actually read.
  2506.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  2507.                     to be read.
  2508.     
  2509.     Result Codes
  2510.         noErr                0        No error
  2511.         readErr                –19        Driver does not respond to read requests
  2512.         badUnitErr            –21        Driver reference number does not
  2513.                                     match unit table
  2514.         unitEmptyErr        –22        Driver reference number specifies a
  2515.                                     nil handle in unit table
  2516.         abortErr            –27        Request aborted by KillIO
  2517.         notOpenErr            –28        Driver not open
  2518.         ioErr                –36        Data does not match in read-verify mode
  2519.         fnOpnErr            -38        File not open
  2520.         rfNumErr            -51        Bad reference number
  2521.         afpAccessDenied        -5000    User does not have the correct access to
  2522.                                     the file
  2523.  
  2524.     __________
  2525.     
  2526.     See also:    FSWriteNoCache
  2527. */
  2528.  
  2529. /*****************************************************************************/
  2530.  
  2531. pascal    OSErr    FSWriteNoCache(short refNum,
  2532.                                long *count,
  2533.                                const void *buffPtr);
  2534. /*    ¶ Write any number of bytes to an open file requesting no caching.
  2535.     The FSReadNoCache function writes any number of bytes to an open file
  2536.     while asking the file system to bypass its cache mechanism.
  2537.     
  2538.     refNum    input:    The file reference number of an open file.
  2539.     count    input:    The number of bytes to write to the file.
  2540.             output:    The number of bytes actually written.
  2541.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  2542.                     to be written.
  2543.     
  2544.     Result Codes
  2545.         noErr                0        No error
  2546.         writErr                –20        Driver does not respond to write requests
  2547.         badUnitErr            –21        Driver reference number does not
  2548.                                     match unit table
  2549.         unitEmptyErr        –22        Driver reference number specifies a
  2550.                                     nil handle in unit table
  2551.         abortErr            –27        Request aborted by KillIO
  2552.         notOpenErr            –28        Driver not open
  2553.         dskFulErr            -34        Disk full    
  2554.         ioErr                –36        Data does not match in read-verify mode
  2555.         fnOpnErr            -38        File not open
  2556.         wPrErr                -44        Hardware volume lock    
  2557.         fLckdErr            -45        File is locked    
  2558.         vLckdErr            -46        Software volume lock    
  2559.         rfNumErr            -51        Bad reference number
  2560.         wrPermErr            -61        Read/write permission doesn’t
  2561.                                     allow writing    
  2562.         afpAccessDenied        -5000    User does not have the correct access to
  2563.                                     the file
  2564.  
  2565.     __________
  2566.     
  2567.     See also:    FSReadNoCache
  2568. */
  2569.  
  2570. /*****************************************************************************/
  2571.  
  2572. pascal    OSErr    FSWriteVerify(short refNum,
  2573.                               long *count,
  2574.                               const void *buffPtr);
  2575. /*    ¶ Write any number of bytes to an open file and then verify the data was written.
  2576.     The FSWriteVerify function writes any number of bytes to an open file
  2577.     and then verifies that the data was actually written to the device.
  2578.     
  2579.     refNum    input:    The file reference number of an open file.
  2580.     count    input:    The number of bytes to write to the file.
  2581.             output:    The number of bytes actually written and verified.
  2582.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  2583.                     to be written.
  2584.     
  2585.     Result Codes
  2586.         noErr                0        No error
  2587.         readErr                –19        Driver does not respond to read requests
  2588.         writErr                –20        Driver does not respond to write requests
  2589.         badUnitErr            –21        Driver reference number does not
  2590.                                     match unit table
  2591.         unitEmptyErr        –22        Driver reference number specifies a
  2592.                                     nil handle in unit table
  2593.         abortErr            –27        Request aborted by KillIO
  2594.         notOpenErr            –28        Driver not open
  2595.         dskFulErr            -34        Disk full    
  2596.         ioErr                –36        Data does not match in read-verify mode
  2597.         fnOpnErr            -38        File not open
  2598.         eofErr                -39        Logical end-of-file reached
  2599.         posErr                -40        Attempt to position mark before start
  2600.                                     of file
  2601.         wPrErr                -44        Hardware volume lock    
  2602.         fLckdErr            -45        File is locked    
  2603.         vLckdErr            -46        Software volume lock    
  2604.         rfNumErr            -51        Bad reference number
  2605.         gfpErr                -52        Error during GetFPos
  2606.         wrPermErr            -61        Read/write permission doesn’t
  2607.                                     allow writing    
  2608.         memFullErr            -108    Not enough room in heap zone to allocate
  2609.                                     verify buffer
  2610.         afpAccessDenied        -5000    User does not have the correct access to
  2611.                                     the file
  2612. */
  2613.  
  2614. /*****************************************************************************/
  2615.  
  2616. pascal    OSErr    CopyFork(short srcRefNum,
  2617.                          short dstRefNum,
  2618.                          void *copyBufferPtr,
  2619.                          long copyBufferSize);
  2620. /*    ¶ Copy all data from the source fork to the destination fork of open file forks.
  2621.     The CopyFork function copies all data from the source fork to the
  2622.     destination fork of open file forks and makes sure the destination EOF
  2623.     is equal to the source EOF.
  2624.     
  2625.     srcRefNum        input:    The source file reference number.
  2626.     dstRefNum        input:    The destination file reference number.
  2627.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  2628.                             buffer should be at least 512-bytes minimum.
  2629.                             The larger the buffer, the faster the copy.
  2630.     copyBufferSize    input:    The size of the copy buffer.
  2631.     
  2632.     Result Codes
  2633.         noErr                0        No error
  2634.         readErr                –19        Driver does not respond to read requests
  2635.         writErr                –20        Driver does not respond to write requests
  2636.         badUnitErr            –21        Driver reference number does not
  2637.                                     match unit table
  2638.         unitEmptyErr        –22        Driver reference number specifies a
  2639.                                     nil handle in unit table
  2640.         abortErr            –27        Request aborted by KillIO
  2641.         notOpenErr            –28        Driver not open
  2642.         dskFulErr            -34        Disk full    
  2643.         ioErr                –36        Data does not match in read-verify mode
  2644.         fnOpnErr            -38        File not open
  2645.         wPrErr                -44        Hardware volume lock    
  2646.         fLckdErr            -45        File is locked    
  2647.         vLckdErr            -46        Software volume lock    
  2648.         rfNumErr            -51        Bad reference number
  2649.         wrPermErr            -61        Read/write permission doesn’t
  2650.                                     allow writing    
  2651.         afpAccessDenied        -5000    User does not have the correct access to
  2652.                                     the file
  2653. */
  2654.  
  2655. /*****************************************************************************/
  2656.  
  2657. pascal    OSErr    GetFileLocation(short refNum,
  2658.                                 short *vRefNum,
  2659.                                 long *dirID,
  2660.                                 StringPtr fileName);
  2661. /*    ¶ Get the location of an open file.
  2662.     The GetFileLocation function gets the location (volume reference number,
  2663.     directory ID, and fileName) of an open file.
  2664.  
  2665.     refNum        input:    The file reference number of an open file.
  2666.     vRefNum        output:    The volume reference number.
  2667.     dirID        output:    The parent directory ID.
  2668.     fileName    input:    Points to a buffer (minimum Str63) where the
  2669.                         filename is to be returned or must be nil.
  2670.                 output:    The filename.
  2671.     
  2672.     Result Codes
  2673.         noErr                0        No error
  2674.         nsvErr                -35        Specified volume doesn’t exist
  2675.         fnOpnErr            -38        File not open
  2676.         rfNumErr            -51        Reference number specifies nonexistent
  2677.                                     access path
  2678.     
  2679.     __________
  2680.     
  2681.     See also:    FSpGetFileLocation
  2682. */
  2683.  
  2684. /*****************************************************************************/
  2685.  
  2686. pascal    OSErr    FSpGetFileLocation(short refNum,
  2687.                                    FSSpec *spec);
  2688. /*    ¶ Get the location of an open file in an FSSpec record.
  2689.     The FSpGetFileLocation function gets the location of an open file in
  2690.     an FSSpec record.
  2691.  
  2692.     refNum        input:    The file reference number of an open file.
  2693.     spec        output:    FSSpec record containing the file name and location.
  2694.     
  2695.     Result Codes
  2696.         noErr                0        No error
  2697.         nsvErr                -35        Specified volume doesn’t exist
  2698.         fnOpnErr            -38        File not open
  2699.         rfNumErr            -51        Reference number specifies nonexistent
  2700.                                     access path
  2701.     
  2702.     __________
  2703.     
  2704.     See also:    GetFileLocation
  2705. */
  2706.  
  2707. /*****************************************************************************/
  2708.  
  2709. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  2710.                                     long srcDirID,
  2711.                                     ConstStr255Param srcName,
  2712.                                     short dstVRefNum,
  2713.                                     long dstDirID,
  2714.                                     ConstStr255Param dstName);
  2715. /*    ¶ Copy the AFP directory access privileges.
  2716.     The CopyDirectoryAccess function copies the AFP directory access
  2717.     privileges from one directory to another. Both directories must be on
  2718.     the same file server, but not necessarily on the same server volume.
  2719.     
  2720.     srcVRefNum    input:    Source volume specification.
  2721.     srcDirID    input:    Source directory ID.
  2722.     srcName        input:    Pointer to source directory name, or nil when
  2723.                         srcDirID specifies the directory.
  2724.     dstVRefNum    input:    Destination volume specification.
  2725.     dstDirID    input:    Destination directory ID.
  2726.     dstName        input:    Pointer to destination directory name, or nil when
  2727.                         dstDirID specifies the directory.
  2728.     
  2729.     Result Codes
  2730.         noErr                0        No error
  2731.         nsvErr                -35        Volume not found
  2732.         fnfErr                -43        Directory not found
  2733.         vLckdErr            -46        Volume is locked or read-only
  2734.         paramErr            -50        Volume doesn't support this function
  2735.         afpAccessDenied        -5000    User does not have the correct access
  2736.                                     to the directory
  2737.         afpObjectTypeErr    -5025    Object is a file, not a directory
  2738.     
  2739.     __________
  2740.     
  2741.     See also:    FSpCopyDirectoryAccess
  2742. */
  2743.  
  2744. /*****************************************************************************/
  2745.  
  2746. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  2747.                                        const FSSpec *dstSpec);
  2748. /*    ¶ Copy the AFP directory access privileges.
  2749.     The FSpCopyDirectoryAccess function copies the AFP directory access
  2750.     privileges from one directory to another. Both directories must be on
  2751.     the same file server, but not necessarily on the same server volume.
  2752.  
  2753.     srcSpec        input:    An FSSpec record specifying the source directory.
  2754.     dstSpec        input:    An FSSpec record specifying the destination directory.
  2755.     
  2756.     Result Codes
  2757.         noErr                0        No error
  2758.         nsvErr                -35        Volume not found
  2759.         fnfErr                -43        Directory not found
  2760.         vLckdErr            -46        Volume is locked or read-only
  2761.         paramErr            -50        Volume doesn't support this function
  2762.         afpAccessDenied        -5000    User does not have the correct access
  2763.                                     to the directory
  2764.         afpObjectTypeErr    -5025    Object is a file, not a directory
  2765.     
  2766.     __________
  2767.     
  2768.     See also:    CopyDirectoryAccess
  2769. */
  2770.  
  2771. /*****************************************************************************/
  2772.  
  2773. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  2774.                                   long srcDirID,
  2775.                                   ConstStr255Param srcName,
  2776.                                   long dstDirID,
  2777.                                   ConstStr255Param dstpathName,
  2778.                                   ConstStr255Param copyName);
  2779. /*    ¶ Move a file or directory and optionally rename it.
  2780.     The HMoveRenameCompat function moves a file or directory and optionally
  2781.     renames it.  The source and destination locations must be on the same
  2782.     volume. This routine works even if the volume doesn't support MoveRename.
  2783.     
  2784.     vRefNum        input:    Volume specification.
  2785.     srcDirID    input:    Source directory ID.
  2786.     srcName        input:    The source object name.
  2787.     dstDirID    input:    Destination directory ID.
  2788.     dstName        input:    Pointer to destination directory name, or
  2789.                         nil when dstDirID specifies a directory.
  2790.     copyName    input:    Points to the new name if the object is to be
  2791.                         renamed or nil if the object isn't to be renamed.
  2792.     
  2793.     Result Codes
  2794.         noErr                0        No error
  2795.         dirFulErr            -33        File directory full
  2796.         dskFulErr            -34        Disk is full
  2797.         nsvErr                -35        Volume not found
  2798.         ioErr                -36        I/O error
  2799.         bdNamErr            -37        Bad filename or attempt to move into
  2800.                                     a file
  2801.         fnfErr                -43        Source file or directory not found
  2802.         wPrErr                -44        Hardware volume lock
  2803.         fLckdErr            -45        File is locked
  2804.         vLckdErr            -46        Destination volume is read-only
  2805.         fBsyErr                -47        File busy, directory not empty, or
  2806.                                     working directory control block open
  2807.         dupFNErr            -48        Destination already exists
  2808.         paramErr            -50        Volume doesn't support this function,
  2809.                                     no default volume, or source and
  2810.         volOfflinErr        -53        Volume is offline
  2811.         fsRnErr                -59        Problem during rename
  2812.         dirNFErr            -120    Directory not found or incomplete pathname
  2813.         badMovErr            -122    Attempted to move directory into
  2814.                                     offspring
  2815.         wrgVolTypErr        -123    Not an HFS volume (it's a MFS volume)
  2816.         notAFileErr            -1302    The pathname is nil, the pathname
  2817.                                     is empty, or the pathname cannot refer
  2818.                                     to a filename
  2819.         diffVolErr            -1303    Files on different volumes
  2820.         afpAccessDenied        -5000    The user does not have the right to
  2821.                                     move the file  or directory
  2822.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2823.         afpSameObjectErr    -5038    Source and destination files are the same
  2824.     
  2825.     __________
  2826.     
  2827.     See also:    FSpMoveRenameCompat
  2828. */
  2829.  
  2830. /*****************************************************************************/
  2831.  
  2832. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  2833.                                     const FSSpec *dstSpec,
  2834.                                     ConstStr255Param copyName);
  2835. /*    ¶ Move a file or directory and optionally rename it.
  2836.     The FSpMoveRenameCompat function moves a file or directory and optionally
  2837.     renames it.  The source and destination locations must be on the same
  2838.     volume. This routine works even if the volume doesn't support MoveRename.
  2839.     
  2840.     srcSpec        input:    An FSSpec record specifying the source object.
  2841.     dstSpec        input:    An FSSpec record specifying the destination
  2842.                         directory.
  2843.     copyName    input:    Points to the new name if the object is to be
  2844.                         renamed or nil if the object isn't to be renamed.
  2845.     
  2846.     Result Codes
  2847.         noErr                0        No error
  2848.         dirFulErr            -33        File directory full
  2849.         dskFulErr            -34        Disk is full
  2850.         nsvErr                -35        Volume not found
  2851.         ioErr                -36        I/O error
  2852.         bdNamErr            -37        Bad filename or attempt to move into
  2853.                                     a file
  2854.         fnfErr                -43        Source file or directory not found
  2855.         wPrErr                -44        Hardware volume lock
  2856.         fLckdErr            -45        File is locked
  2857.         vLckdErr            -46        Destination volume is read-only
  2858.         fBsyErr                -47        File busy, directory not empty, or
  2859.                                     working directory control block open
  2860.         dupFNErr            -48        Destination already exists
  2861.         paramErr            -50        Volume doesn't support this function,
  2862.                                     no default volume, or source and
  2863.         volOfflinErr        -53        Volume is offline
  2864.         fsRnErr                -59        Problem during rename
  2865.         dirNFErr            -120    Directory not found or incomplete pathname
  2866.         badMovErr            -122    Attempted to move directory into
  2867.                                     offspring
  2868.         wrgVolTypErr        -123    Not an HFS volume (it's a MFS volume)
  2869.         notAFileErr            -1302    The pathname is nil, the pathname
  2870.                                     is empty, or the pathname cannot refer
  2871.                                     to a filename
  2872.         diffVolErr            -1303    Files on different volumes
  2873.         afpAccessDenied        -5000    The user does not have the right to
  2874.                                     move the file  or directory
  2875.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2876.         afpSameObjectErr    -5038    Source and destination files are the same
  2877.     
  2878.     __________
  2879.     
  2880.     See also:    HMoveRenameCompat
  2881. */
  2882.  
  2883. /*****************************************************************************/
  2884.  
  2885. pascal    OSErr    BuildAFPVolMountInfo(short flags,
  2886.                                      char nbpInterval,
  2887.                                      char nbpCount,
  2888.                                      short uamType,
  2889.                                      Str32 zoneName,
  2890.                                      Str31 serverName,
  2891.                                      Str27 volName,
  2892.                                      Str31 userName,
  2893.                                      Str8 userPassword,
  2894.                                      Str8 volPassword,
  2895.                                      AFPVolMountInfoPtr *afpInfoPtr);
  2896. /*    ¶ Allocate and initializes the fields of an AFPVolMountInfo record.
  2897.     The BuildAFPVolMountInfo function allocates and initializes the fields
  2898.     of an AFPVolMountInfo record before using that record to call
  2899.     the VolumeMount function.
  2900.     
  2901.     flags            input:    The AFP mounting flags. 0 = normal mount;
  2902.                             set bit 0 to inhibit greeting messages.
  2903.     nbpInterval        input:    The interval used for VolumeMount's
  2904.                             NBP Lookup call. 7 is a good choice.
  2905.     nbpCount        input:    The retry count used for VolumeMount's
  2906.                             NBP Lookup call. 5 is a good choice.
  2907.     uamType            input:    The user authentication method to use.
  2908.     zoneName        input:    The AppleTalk zone name of the server.
  2909.     serverName        input:    The AFP server name.
  2910.     volName            input:    The AFP volume name.
  2911.     userName        input:    The user name (zero length Pascal string for
  2912.                             guest).
  2913.     userPassWord    input:    The user password (zero length Pascal string
  2914.                             if no user password)
  2915.     volPassWord        input:    The volume password (zero length Pascal string
  2916.                             if no volume password)
  2917.     afpInfoPtr        output:    A pointer to the newly created and initialized
  2918.                             AFPVolMountInfo record. If the function fails to
  2919.                             create an AFPVolMountInfo record, it sets
  2920.                             afpInfoPtr to NULL and the function result is
  2921.                             memFullErr. Your program is responsible
  2922.                             for disposing of this pointer when it is finished
  2923.                             with it.
  2924.     
  2925.     Result Codes
  2926.         noErr                0        No error
  2927.         memFullErr            -108    memory full error
  2928.     
  2929.     __________
  2930.     
  2931.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  2932.                 RetrieveAFPVolMountInfo, BuildAFPXVolMountInfo,
  2933.                 RetrieveAFPXVolMountInfo
  2934. */
  2935.  
  2936. /*****************************************************************************/
  2937.  
  2938. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr afpInfoPtr,
  2939.                                         short *flags,
  2940.                                         short *uamType,
  2941.                                         StringPtr zoneName,
  2942.                                         StringPtr serverName,
  2943.                                         StringPtr volName,
  2944.                                         StringPtr userName);
  2945. /*    ¶ Retrieve the AFP mounting information from an AFPVolMountInfo record.
  2946.     The RetrieveAFPVolMountInfo function retrieves the AFP mounting
  2947.     information returned in an AFPVolMountInfo record by the
  2948.     GetVolMountInfo function.
  2949.     
  2950.     afpInfoPtr        input:    Pointer to AFPVolMountInfo record that contains
  2951.                             the AFP mounting information.
  2952.     flags            output:    The AFP mounting flags.
  2953.     uamType            output:    The user authentication method used.
  2954.     zoneName        output:    The AppleTalk zone name of the server.
  2955.     serverName        output:    The AFP server name.
  2956.     volName            output:    The AFP volume name.
  2957.     userName        output:    The user name (zero length Pascal string for
  2958.                             guest).
  2959.     
  2960.     Result Codes
  2961.         noErr                0        No error
  2962.         paramErr            -50        media field in AFP mounting information
  2963.                                     was not AppleShareMediaType
  2964.     
  2965.     __________
  2966.     
  2967.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  2968.                 BuildAFPVolMountInfo, BuildAFPXVolMountInfo,
  2969.                 RetrieveAFPXVolMountInfo
  2970. */
  2971.  
  2972. /*****************************************************************************/
  2973.  
  2974. pascal    OSErr    BuildAFPXVolMountInfo(short flags,
  2975.                                       char nbpInterval,
  2976.                                       char nbpCount,
  2977.                                       short uamType,
  2978.                                       Str32 zoneName,
  2979.                                       Str31 serverName,
  2980.                                       Str27 volName,
  2981.                                       Str31 userName,
  2982.                                       Str8 userPassword,
  2983.                                       Str8 volPassword,
  2984.                                       Str32 uamName,
  2985.                                       unsigned long alternateAddressLength,
  2986.                                       void *alternateAddress,
  2987.                                       AFPXVolMountInfoPtr *afpXInfoPtr);
  2988. /*    ¶ Allocate and initializes the fields of an AFPXVolMountInfo record.
  2989.     The BuildAFPXVolMountInfo function allocates and initializes the fields
  2990.     of an AFPXVolMountInfo record before using that record to call
  2991.     the VolumeMount function.
  2992.     
  2993.     flags                    input:    The AFP mounting flags.
  2994.     nbpInterval                input:    The interval used for VolumeMount's
  2995.                                     NBP Lookup call. 7 is a good choice.
  2996.     nbpCount                input:    The retry count used for VolumeMount's
  2997.                                     NBP Lookup call. 5 is a good choice.
  2998.     uamType                    input:    The user authentication method to use.
  2999.     zoneName                input:    The AppleTalk zone name of the server.
  3000.     serverName                input:    The AFP server name.
  3001.     volName                    input:    The AFP volume name.
  3002.     userName                input:    The user name (zero length Pascal string
  3003.                                     for guest).
  3004.     userPassWord            input:    The user password (zero length Pascal
  3005.                                     string if no user password)
  3006.     volPassWord                input:    The volume password (zero length Pascal
  3007.                                     string if no volume password)
  3008.     uamName                    input:    The User Authentication Method name.
  3009.     alternateAddressLength    input:    Length of alternateAddress data.
  3010.     alternateAddress        input    The AFPAlternateAddress (variable length)
  3011.     afpXInfoPtr                output:    A pointer to the newly created and
  3012.                                     initialized AFPVolMountInfo record.
  3013.                                     If the function fails to create an
  3014.                                     AFPVolMountInfo record, it sets
  3015.                                     afpInfoPtr to NULL and the function
  3016.                                     result is memFullErr. Your program is
  3017.                                     responsible for disposing of this pointer
  3018.                                     when it is finished with it.
  3019.     
  3020.     Result Codes
  3021.         noErr                0        No error
  3022.         memFullErr            -108    memory full error
  3023.     
  3024.     __________
  3025.     
  3026.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  3027.                 BuildAFPVolMountInfo, RetrieveAFPVolMountInfo,
  3028.                 RetrieveAFPXVolMountInfo
  3029. */
  3030.  
  3031. /*****************************************************************************/
  3032.  
  3033. pascal    OSErr    RetrieveAFPXVolMountInfo(AFPXVolMountInfoPtr afpXInfoPtr,
  3034.                                          short *flags,
  3035.                                          short *uamType,
  3036.                                          StringPtr zoneName,
  3037.                                          StringPtr serverName,
  3038.                                          StringPtr volName,
  3039.                                          StringPtr userName,
  3040.                                          StringPtr uamName,
  3041.                                          unsigned long *alternateAddressLength,
  3042.                                          AFPAlternateAddress **alternateAddress);
  3043. /*    ¶ Retrieve the AFP mounting information from an AFPXVolMountInfo record.
  3044.     The RetrieveAFPXVolMountInfo function retrieves the AFP mounting
  3045.     information returned in an AFPXVolMountInfo record by the
  3046.     GetVolMountInfo function.
  3047.     
  3048.     afpXInfoPtr                input:    Pointer to AFPXVolMountInfo record that
  3049.                                     contains the AFP mounting information.
  3050.     flags                    output:    The AFP mounting flags.
  3051.     uamType                    output:    The user authentication method used.
  3052.     zoneName                output:    The AppleTalk zone name of the server.
  3053.     serverName                output:    The AFP server name.
  3054.     volName                    output:    The AFP volume name.
  3055.     userName                output:    The user name (zero length Pascal
  3056.                                     string for guest).
  3057.     uamName                    output:    The User Authentication Method name.
  3058.     alternateAddressLength    output:    Length of alternateAddress data returned.
  3059.     alternateAddress:        output:    A pointer to the newly created and
  3060.                                     AFPAlternateAddress record (a variable
  3061.                                     length record). If the function fails to
  3062.                                     create an AFPAlternateAddress record,
  3063.                                     it sets alternateAddress to NULL and the
  3064.                                     function result is memFullErr. Your
  3065.                                     program is responsible for disposing of
  3066.                                     this pointer when it is finished with it.
  3067.     
  3068.     Result Codes
  3069.         noErr                0        No error
  3070.         paramErr            -50        media field in AFP mounting information
  3071.                                     was not AppleShareMediaType
  3072.         memFullErr            -108    memory full error
  3073.     
  3074.     __________
  3075.     
  3076.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  3077.                 BuildAFPVolMountInfo, RetrieveAFXVolMountInfo,
  3078.                 BuildAFPXVolMountInfo
  3079. */
  3080.  
  3081. /*****************************************************************************/
  3082.  
  3083. pascal    OSErr    GetUGEntries(short objType,
  3084.                              UGEntryPtr entries,
  3085.                              long reqEntryCount,
  3086.                              long *actEntryCount,
  3087.                              long *objID);
  3088. /*    ¶ Retrieve a list of user or group entries from the local file server.
  3089.     The GetUGEntries functions retrieves a list of user or group entries
  3090.     from the local file server.
  3091.  
  3092.     objType            input:    The object type: -1 = group; 0 = user
  3093.     UGEntries        input:    Pointer to array of UGEntry records where the list
  3094.                             is returned.
  3095.     reqEntryCount    input:    The number of elements in the UGEntries array.
  3096.     actEntryCount    output:    The number of entries returned.
  3097.     objID            input:    The current index position. Set to 0 to start with
  3098.                             the first entry.
  3099.                     output:    The index position to get the next entry. Pass this
  3100.                             value the next time you call GetUGEntries to start
  3101.                             where you left off.
  3102.     
  3103.     Result Codes
  3104.         noErr                0        No error    
  3105.         fnfErr                -43        No more users or groups    
  3106.         paramErr            -50        Function not supported; or, ioObjID is
  3107.                                     negative    
  3108.  
  3109.     __________
  3110.     
  3111.     Also see:    GetUGEntry
  3112. */
  3113.  
  3114. /*****************************************************************************/
  3115.  
  3116. #ifdef __cplusplus
  3117. }
  3118. #endif
  3119.  
  3120. #include "OptimizationEnd.h"
  3121.  
  3122. #endif    /* __MOREFILESEXTRAS__ */
  3123.